Hey guys, I've been working on creating a new game engine in b4a. I've played with AcceleratedSuface library and managed to animate michael jackson from some moonwalker arcade game sprite sheets (lol) at 60fps.
I just had some questions regarding game engines in general.
From what i've figured out so far, I need:
1) something that can play multiple sounds without performance degredation. So far i've used the media player object for bg music. I have no idea how the threading works as far as that goes though because It can play sound while the activity is taking events etc... so I don't know if its on another thread or what.
I just figured I could make an array of media players all the sound effects in the game, loading em all as needed prior to starting a level. Then calling .play as needed. Any input on this is welcome
2) a class to define animations by specifying frame info and frame duration and put those in an array property of a sprite class to be called as needed. The sprite would hold some other info maybe, not quite sure yet lol. So far i load the sprite sheet png, then crop smaller bitmaps out of it, and unload the sprite sheet to save memory. I stick those into the array for quick drawing access from memory.
3) a player/object class to hold co-ordinates and basic object info, and an attributes class that can be added against another set of attributes (such as equipping an item) and add the totals up, or perform attack calculations.
4) some code to handle input
5) a loop for the game to use. I already got this, i'm assuming it's the draw() loop. calculate, then draw over and over.
6) Artwork and music, luckily my girl is an artist, and my cousin a musician
if there's anything i'm missing or any comments, please let me know. I've tried to follow a book on android game programming, but it gets a bit complicated. Not sure what the b4a equivalent of making a service for playing sounds in a different thread is for example. The good part is that at least since b4a supports classes now, and useful libraries are already made, it greatly simplifies a lot of my work.
http://www.youtube.com/watch?v=li2cpCMjWuU
I just had some questions regarding game engines in general.
From what i've figured out so far, I need:
1) something that can play multiple sounds without performance degredation. So far i've used the media player object for bg music. I have no idea how the threading works as far as that goes though because It can play sound while the activity is taking events etc... so I don't know if its on another thread or what.
I just figured I could make an array of media players all the sound effects in the game, loading em all as needed prior to starting a level. Then calling .play as needed. Any input on this is welcome
2) a class to define animations by specifying frame info and frame duration and put those in an array property of a sprite class to be called as needed. The sprite would hold some other info maybe, not quite sure yet lol. So far i load the sprite sheet png, then crop smaller bitmaps out of it, and unload the sprite sheet to save memory. I stick those into the array for quick drawing access from memory.
3) a player/object class to hold co-ordinates and basic object info, and an attributes class that can be added against another set of attributes (such as equipping an item) and add the totals up, or perform attack calculations.
4) some code to handle input
5) a loop for the game to use. I already got this, i'm assuming it's the draw() loop. calculate, then draw over and over.
6) Artwork and music, luckily my girl is an artist, and my cousin a musician
if there's anything i'm missing or any comments, please let me know. I've tried to follow a book on android game programming, but it gets a bit complicated. Not sure what the b4a equivalent of making a service for playing sounds in a different thread is for example. The good part is that at least since b4a supports classes now, and useful libraries are already made, it greatly simplifies a lot of my work.
http://www.youtube.com/watch?v=li2cpCMjWuU
Last edited: