Custom Font DEMO - now more CPU friendly!
firemaplegames
Member Posts: 3,211
Hey All,
I just rebuilt my custom score font demo:
http://gamesalad.com/game/play/31065
The other one was hitting the CPU pretty hard. It used to work by having a Constrain Attribute for each digit, as well as 10 Rules per digit to set the image.
I rebuilt it to set the image using concatenation as opposed to having 10 separate Rules. It still needs a Constrain Attribute to work. In the demo I have a 5-digit score, and on my 3GS, the frames rarely drop below 60 - even if I tap like mad.
At the very least, I just eliminated 50 Rules that were getting checked every time.
Your mileage may vary of course, but it seems pretty solid to me.
I haven't changed the other custom font demos yet, so if you're using them, please apply this method to those.
Thanks!
Joe
I just rebuilt my custom score font demo:
http://gamesalad.com/game/play/31065
The other one was hitting the CPU pretty hard. It used to work by having a Constrain Attribute for each digit, as well as 10 Rules per digit to set the image.
I rebuilt it to set the image using concatenation as opposed to having 10 separate Rules. It still needs a Constrain Attribute to work. In the demo I have a 5-digit score, and on my 3GS, the frames rarely drop below 60 - even if I tap like mad.
At the very least, I just eliminated 50 Rules that were getting checked every time.
Your mileage may vary of course, but it seems pretty solid to me.
I haven't changed the other custom font demos yet, so if you're using them, please apply this method to those.
Thanks!
Joe
Comments
The saving of FPS is always welcome!
Cheers!
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
When you download the file, you'll get a .game file.
You have to change the .game extension to .zip
Then double-click on the .zip to extract the .gameproj file.
The way you did it is the way I would do it, just open it right up through gamesalad creator, under the Shared Projects tab.
BTW, the score demo looks great, especially for those of us mathematically challenged. :-)
Thanks again.
also I've never done any of that stuff with the whole zip thing
I just open up gs and hit shard projects as oppsed to rcent or new. type th name or a word from the name in the little seach box.
Also a great way to browse demos if you hit templates only.
Opens right up in the editor.
On my iPod and 3gs there was no hit at all
I mean maybe if you had a read out or something but I certainly couldn't notice anything
althogh maybe it was your high score formula that was crashing everyones browser..... Jk
anyways thanks this is very nice and so easy to add in
Yeah, combining things like that is called concatenation. It's a pretty basic programming technique.
I've asked (begged?) for them to add that ability everywhere, especially to the Change Scene behavior.
i.e:
Change Scene
"Scene "..(game.currentScene+1)
or
Change Scene
"Scene "..random(1,50)
It would make my life soooo much easier. And allow me to chop out literally 600 Rules from each of my games.
The way they currently have it where you need to select everything from drop downs avoids these issues for new programmers...
But I would rather have possible syntax errors than carpal tunnel syndrome!
Combine them with arrays and you open up all sorts of dynamic content and without the input headache as FMG mentions.
<hint, hint DEVs>