It looks like you're new here. If you want to get involved, click one of these buttons!
--works with any type of Texture, not only TexturePack. local pack = TexturePack.new("runnerSheetData.txt", "runnerSheet.png"); local imgTab = { pack:getTextureRegion("stickfall1.png"), pack:getTextureRegion("stickfall2.png"), pack:getTextureRegion("stickfall3.png"), pack:getTextureRegion("stickjump1.png"), pack:getTextureRegion("stickjump2.png"), pack:getTextureRegion("stickjump3.png"), pack:getTextureRegion("stickrun1.png"), pack:getTextureRegion("stickrun2.png"), pack:getTextureRegion("stickrun3.png"), }; local runner = GCanimObj.new(imgTab); --gives back a Sprite --we add some animation. --First parameter contains the name of the animation --The numbers in the table of the second parameter corresponds to the texture we put into imgTab earlier, -- and tell the class the frames that must be used for that particular animation --The third parameter is the enterFrame cycles it takes from one frame of the animation to the other. In this case, the whole animation "falling" will be played in 30 enterFrame cycles, meaning, at 60fps, half a second. --The last parameter tells how many times the animation should be played. If set to 0, the animation will play endlessly. runner:addAnim("falling", {1, 2, 3}, 10, 1); runner:addAnim("jumping", {4, 5, 6}, 10, 1); runner:addAnim("running", {7, 8, 9}, 5, 0); --Selecting an animation to play runner:prepare("running"); --Playing the animation runner:play(); --pausing the animation runner:pause(); --changing the frame displaying runner:changeFrame(2); --checking if an animation is playing print(runner.animating) --reports true if it is --checking which animation is playing print(runner.sequence) --reports the name of the animation playing |
Comments
I think your price point is perfect (fair price for everyone). Let me know when you're done! =D>
Sid
Likes: phongtt
The Runner Template for Gideros Mobile is done.
You can get it directly there, going through paypal (;
For any question, you can mail me at hachisoft[at]hotmail[dot].it, or directly here (:
Thank you,
Cristian
Likes: gorkem, atilim
Sid
Do you see the same fps with player itself? (while not running anything?)
@adnaan is that good enough on that device? Not much of an android guy there, so I don't know the specifics.
One other way to do it would be to move the player instead, fixing the level to it's X, like I've done in the Doodle Jump sample, then checking blocks global coordinate to create-remove. The parallax could do the same, while moving on the right at a lower speed than the scene.
I'll try that out and see how it goes (:
I would recommend that for android you do the following as soon as possible(if you have not done it already). Please do not wait for users to complain because it is a major problem. This is not a huge task, only minor tweaks. Morever unlike iOS, there are no good 2D game development tools available for android right now:
1. PVRTC, DXT compression for OMAP and Tegra Devices respectively.(gives you upto 30-40 % performance improvement !!)
2. Use architecture specific GPU features for different class of devices. OEM's differentiate their hardware(which is mostly same) by providing their own api's to do some cool things.
3. Use RenderScript API to render. It has CUDA like parallel processing features. NO JNI CALLS!(10-20% performance improvement)
The third suggestion probably would be a big task for you. But, it can give you "that" edge.
@H4ch1 It is good enough for the device "now",there may be a performance hit when I upload textures with it. This device is pretty good and is able to run 3d games like "Wind-Up Knight" smoothly. I will test more and let you know. BTW great job with the template, I love it.
We directly stuck with OpenGL ES 1.1 and aren't using any extensions up to now.
1. To tell the truth, I don't like the results of PVRTC It mostly ruins the beauty of images. I guess PVRTC is %30-%40 faster because of cache utilization, right? But we will support 16-bit textures soon and they look as good as 32-bit textures with good dithering. (Maybe PVRTC support will come next.) Do you know if there is a standart between Android devices about PVRTC? For example, is there any Android devices that supports OpenGL but not PVRTC?
2. Do you know any documentation or web site about this? I would like to read.
3. I haven't heard about RenderScript before. On http://developer.android.com/guide/topics/renderscript/index.html, it says:
Renderscript provides similar performance to OpenGL with the NDK... We directly use OpenGL through NDK and only use JNI for platform specific features like accelerometer, gyro, http access, etc. I assume there won't be any change on performance if we move to RenderScript. What do you think?
Thank you for these great recommendations
cheers,
1. I should have been more clear. PVRTC has nothing do with Android. Its just a compression format supported by a large numger of Graphics Technology Vendors. The most important of them is Imgtec. Imgtec opengl drivers are mostly present in all kinds of devices(ios, android, others). The key is to use Imgtec core features and api, one of which is texture compression.
Any compression format(pvrtc, dxt) is faster because it divides up the textures into tiles(16x16 or32x32 or 64x64) and puts it in a format which is more readable by the GPU. Without compression there is an overhead for the GPU to first convert the textures into a more readable format. Texture compression has no effect on quality(its lossless). The "loss of beauty" you are talking about is due to incorrect compression for the particular platform(i.e OMAP, Tegra, SnapDragon, MIPS)
You have to categorize android devices by platform(i.e whether OMAP, or Tegra, or SnapDragon or MIPS). The main vendor providing opengl es drivers is IMGTEC.(except perhaps MIPS not sure). Each platform vendor choses to implement the imgtec opengl driver in their own way. Some add features and some remove them. If I had to build a game engine, I would support atleast OMAP and Tegra platforms because they have the lions share of the mobile market.
2. http://www.imgtec.com/developers.asp :: this is the most important link. read everything!
http://developer.nvidia.com/tegra-resources
The android mobile ecosystem is so bifurcated that there is no central documentation related to opengl. But that is what makes it awesome for small companies like yours. you can support features which no one else does and be more profitable.
3. RenderScript is LLVM (https://events.linuxfoundation.org/slides/2011/lfcs/lfcs2011_llvm_liao.pdf)
JNI overhead per call as you may noticed is about 100-140 ms. It is higher if you have to share larger data. Moreover to do multi-threading in JNI is a pain, since the DALVIK does not know anything about it and so you have to do your own GC. DALVIK has a set heap for each app and if your heap size increases the limit of 16mb, the app crashes. Renderscipt takes care of that since the threads are now managed by core android api.
Renderscript is JIT unlike JNI. If you use renderscript your app is bound to get faster by 10-20 % and for heavier games the efficiency can get upto 30 %!. I am guaranteeing it. There are a bunch of other benefits.
NDK now is only good for quick porting of your existing libraries.
One more thing: Renderscript stable version was released just 2 months ago with ICS, so there is no competition there right now. You will sell like hot cakes just on the buzz factor.!!
Dislikes: amin13a
http://www.karnakgames.com/wp/gideros-svg-level-builder/
A lot of independent devs cannot necessarily afford the latest hardware so buy second-hand older models for test purposes and these are the devices that Renderscript no longer supports.
Website: http://www.castlegateinteractive.com
https://play.google.com/store/apps/developer?id=Castlegate+Interactive
[cynical mode]Or were you just bumping it so you can attract more custom for your template now that Gideros is a lot more popular? [/cynical mode]
)
Website: http://www.castlegateinteractive.com
https://play.google.com/store/apps/developer?id=Castlegate+Interactive
Maybe he is the old @H4ch1 with a new nick Name
The New Adventures of Old @H4ch1 ?
@h24h feel free to check your e-mail box...
http://www.karnakgames.com/wp/gideros-svg-level-builder/
Likes: KeepTrying
https://play.google.com/store/apps/developer?id=My+name+is+Originality
)
Likes: gorkem, KeepTrying
@KeepTrying: I read your post saying you sent @H4ch1 an email. Then @h24h necro's a nearly year old thread and my ancient brain decided they were the same person.
Move along now, nothing to see here
Likes: KeepTrying
Website: http://www.castlegateinteractive.com
https://play.google.com/store/apps/developer?id=Castlegate+Interactive