DawnOfTheRent said:
<snip>
I'm not even sure what you're meaning by “framework” I used to think it was just a way of setting up a compiler to create a binary for a certain architecture, but in the context here, it seems to be something else/more.<snip>
<snip> I'm not sure yet how to use PNGs instead of Bitmaps, but I'm pretty sure I can figure this out when I finish working on my sprites.
(And if it's worth mentioning, I'd vote for having music played by the main interface, this would allow it to be more seamless and “professional” (like Alex's Air hockey game for the GP2X), and would keep me from having to look up how to use .MODs
).
The framework is the engine, and all the provided utility classes. Also the StateMain inteface calss can be considered part of the framework in this case. Bascially a lot of the work has been done for you, so you "only" have to fill in the blanks. And it will be up to me to get this compiling on the Pandora too.(something I want to do anyway.)
to use png as sprites, just follow the space invaders example. you can do:
CODE
#include "AnimatedSprite.h"
void miniGame::init()
{
AnimatedSprite mySprite; // do this line in your mini-game header!!
mySprite.loadFrames("images/myMiniGame/mySpriteSheet.png", 14, 1); // we have 14 tiles accross 14x1 tiles
mySprite.setFrameRate(FIFTEEN_FRAMES); // can be THIRTY or SIXTY too default is FIFTEEN
mySprite.setLooping(true); // auto loop the animation or not.
}
void miniGame::update()
{
mySprite.update(); // update the animation
mySprite.setPosition(300,200); // x,y
}
void miniGame::render(SDL_Surface* screen)
{
mySprite.render(screen);
}
Sprites are like this:
CODE
#include "Sprite.h"
void miniGame::init()
{
Sprite mySprite;
mySprite.loadSprite("images/myMiniGame/mySprite.png");
}
void miniGame::update()
{
mySprite.setPosition(300,200); // x,y
}
void miniGame::render(SDL_Surface* screen)
{
mySprite.render(screen);
}
well I'm not sure how that ties in with have victory music and failure music... I'll look into it, but I really need someone to contact me about music, because we still have pretty much none...
Loading music is very easy too, incidentally:
CODE
#include "Music.h"
void miniGame::init()
{
Music myMusic;
mySprite.loadMusic("music/myMiniGame/myMusic.mod");//(mp3,ogg,wav)
}
void miniGame::update()
{
bool anEvent = true;
if(anEvent)
myMusic.play();
}
Sound class works in a very similar way. you don't have to worry about initialising or de-initialising the sound, I'm taking care of that... I do need to update the package though since the current version isn't doing anything with sound.
Also declare your objects in the header. I've done it in a function just for demo purposes.
I realise it's a lot of files, the Penjin Base is full of things you don't need to worry too much about, they are all to help you make a game. In the PandoraPanic folder just copy-paste the SpaceInvaders class and work from there.