Archive for February, 2021

23
Feb
21

Updating the Android version

Now when the majority of all changes are implemented in the coming iOS version, the work has begun implementing them in the Android version too.

This is unfortunately not a matter of cut and paste since the two projects are two completely different code bases. The apps just look the same. Behind the interface the iOS version is written in Objective-C using Cocos2d as the main graphics engine. The Android version is written in Java and uses AndEngine GLES-2 as the main graphics engine.

Sure, the ideas and code approaches are the same but I need to rewrite the code. Let’s take an easy example. We want to create a string with the text “The player Richard is excluded from the fight” where “Richard” is a variable and “The player … is excluded from the fight” is a string that is in different languages depending on where the player is from.

So in iOS:
NSString *strText = [NSString stringWithFormat:AMLocalizedString(@”str_playerexcluded”, nil), strPlayerName];

In Android:
String strText = String.format(this.getResources().getString(R.string.str_playerexcluded), strPlayerName);


So yes, they are similar but still I can’t cut and paste anything.

And regarding 2D-graphics. Let’s assume we have a bitmap (Say… a ball) that we want to rotate a full 360′ in 5 seconds.

In Cocos2d (for iOS):
id rot = [CCActionRotate actionWithDuration:5 angle:360];
[pBall runAction:rot];


In AndEngine (for Android)
RotationModifier rot = new RotationModifier(5, 0, 360);
pBall.registerEntityModifier(rot);

So it’s a lot of work and that’s why the Android version will take some time more to be finished.

Right now I’m working hard on the new Dialogs for the Android version. Up until now the dialogs (pop up windows) have looked rubbish on the Android version and that’s because I’ve used the built in Android views which are difficult to make beautiful since there is no pixel positioning. You always have to place an object “next to” or “below” or “above” something else. Not “At position 100,50”. So I have instead created my own dialog system mimicing the dialog system on iOS so that it will be easy for me in the future to create new dialogs.

While doing that I stumbled upon a problem: Word wrap of text.
This is neatly built in in the iOS system but not so well in AndEngine. Sure, there is a word wrap function that automatically wraps a string by word or letter if it doesn’t fit but unfortunately it doesn’t take newlines into account. If I have a string looking like this “I want to have a dog\nAnd a cat\nAnd a small bird that says beeep”, it would look like this on iOS:

I want to have a dog
And a cat
And a small bird that
says beeep


Unfortunately AndEngine gives me this:
I want to have a dog And
a cat And a small bird that
says beeep


So for the first time since I began using AndEngine I had to jump into it’s code and make some changes in the following files:
AutoWrap.java (at line 16)
NEWLINESANDWORDS,

FontUtils.java (at line 155)
case NEWLINESANDWORDS:
return FontUtils.splitLinesByNewlinesAndWords(pFont, pText, pResult, pAutoWrapWidth);

And then add this function in the same file:
private static > L splitLinesByNewlinesAndWords(final IFont pFont, final CharSequence pText, final L pResult, final float pAutoWrapWidth) {
ArrayList newArr = new ArrayList(1);
splitLines(pText, pResult);
for(CharSequence strLine : pResult) {
if (strLine.equals(“”)) newArr.add(” “);
else splitLinesByWords(pFont, strLine, newArr, pAutoWrapWidth);
}
return (L) newArr;
}


The code is a little ugly but it actually works so I will leave it as this and maybe return another day to make it better.

10
Feb
21

Working on v2.11 for Android and iOS

I will try to release all four apps at the same time in a week or so (RummyFight, RummyFight-Lite for iOS and RummyFight, RummyFight-Free for Android).

The release will be called v2.11 and will contain a lot of bug fixes but also new features. This is what I have added/changed/implemented so far

TRANSLATIONS
* Replaced the german word Reihen (Runs) to Straßen
* Replaced the swedish word Gåva (Gift) to Present
* Replaced the swedisg word Lista (Bookmarks) to Vänlista

DIALOGS
* Close button now has a click sound
* When using english language, ProfileDialog now translates LastActive
* HTML information is now in correct size when used in dialogs
* Individual Statistics is now redesigned to look better
* You can now write a private note on a player (to remember something for yourself)
* If a player has played Tetpuz, his/her best score is now shown in ProfileDialog
* You can now change your own description in ProfileDialog
* FeedbackDialog in ABOUT now looks and fit the screen better
* In CHAT, click and longpress on a profile pic has now swapped functionality
* In WaitMatchDialog a click on a profile pic now plays the click sound

GENERIC
* Texts in buttons now always fit (size changed if needed)

CHAT
* Times in the chat now updates every second
* New “Start Fight”-button in the chat allowing quick starts with people in the chat

LOBBY
* Chat icon is now a little animated
* New icon (Gift) that is visible if there is a gift not yet viewed in a fight
* A Fight is now alerting also if it’s only 10 minutes or less left
* Fixed bug that made a fight still “flash” even though you had accepted it

BOARD
* FightClock is now moved in from off screen
* Possibility to Disable/Enable a theme from within a fight
* Dutch text in FastForward-button does fit now

NEWFIGHT
* Listbox is corrected so that all friends fit (if you have many)
* Added search filter for “Last active”. (Latest day, latest week etc)
* Increased number of possible search results from 50 to 100
* Filter on age does not anymore return players without their age set

TETPUZ
* Instructions for dutch players are now in dutch instead of swedish 🙂
* Highscore names are now clickable and opens ProfileDialog
* Fixed bug that sometimes didn’t save scores correctly in server

GIFTS
* New Gift: Sadness
* New Gift: Balloons
* New Gift: (I won’t tell you this one – you will have to find it yourself)
* Fireworks fixed and works now again
* Improved the looks of Hearts-gift and Broom-gift
* Color corrected some gifts that was more yellow than others

All these things are implemented in the next iOS version now. Next week I will implement them in Android too.

RummyFight is unfortunately NOT the same app for both systems but two completely different projects and code so I can’t use anything from one system to another. If I add a balloon to iOS, I have to open the Android project and add the balloon there too.

But that’s just the way it is.

02
Feb
21

RummyFight-Lite for iOS

Since about two weeks we finally have a free version of RummyFight for iOS too. There has “always” been a free version for Android called RummyFight-Free but now the same app exists for iOS too but it’s called RummyFight-Lite since the word “Free” is forbidden by Apple in an app name.

And since RF-Lite had some new features compared to the paid version, that one too was updated with the new code so now we have both RF and RF-Lite v2.10 available for iOS.

I hope you like them




Categories