Pandora Pandora Panic


HOWTO: Start developing a mini-game (in Linux)

This is my experience with Linux. The setup may not be helpful to anybody else.
This is pretty minimal, too: barely worth the post! But if there's someone
else out there as clueless as I am, here it is:

Setup
  • Install code blocks and SDL dev libraries
  • Download the latest framework
  • Extract framework into an empty directory.
  • Run codeblocks, opening an existing project, which is the .cbp file in the PandoraPanic directory you just created
  • Accept changing all the files to build with GNU GCC
  • In the toolbar at top, change your "Build Target" to "Lin Release"
  • If you're starting from scratch, you're ready to go to it! I started out by playing with the SpaceInvaders game to see how things worked, eventually changing pretty much all of it but appreciating the framework it provided. Thanks, pstudio!
Moving your source to a new framework

It seems to take about three steps:

1. Move all your files into the new framework. For me these were:
  • My State____.cpp file
  • My State____.h file
  • My images/_______ directory of pngs
2. Add your new files to the project! Use pull down menu "Project -> Add Files..."

3. Edit the following files to include your game. Just look for where they deal with SpaceInvaders and add your game in, too.
  • MiniGames.h
  • MyGame.cpp
  • userStates.h
Hint: while developing, it's nice to have the framework run only your game! I achieved this in MiniGames.h by setting MAX_GAMES=1 and then placing my game first in the list.


--Todd
 
Last edited by a moderator:
todd said:
Should there be an escape key to quit a mini-game? If so, which one should be standard across games? There was one in SpaceInvaders (it works out to the right shift key on my , so I left it in my game. But I noticed it missing from the Spelling Bee.
The problem is I don't know how the Pandora SDL libs handle joysticks. I would not worry about an escape command right now, I intend to put it in once I know what's happening. for now you could just set it to the escape key. Regardless it's an easy thing to copy and paste accross the mini-games.

todd said:
  • When I use the above-mentioned escape key from mid-game, the program no longer quits, but hangs with a message: "Penjin says: Shutting Down."
  • Sound still doesn't work on my Linux box (Ubuntu 8.04). I didn't investigate too far. But Spelling Bee still gets stuck. So I enabled the timeout and ||'d it with the the music ending. One might consider leaving something along these lines in the code in case of future conditions where sound is unavailable (e.g., a Pandora with messed-up sound drivers/settings/external hardware).
  • It seems the Sprite.rotate is still broken. My sprite still disappears when I call it.
  • Strangest of all: with the new framework, after starting off at normal (slightly faster?) speed as in the "old" framework (from last week), my game quickly changes to running at about half speed. Any idea??

  • Sounds like a bug to me... I'll have to investigate. If you have valgrind installed, you could run it through it to see if it spots anything.
  • Yes it's a solution, I was in two minds, but I figured Pandoras are standard, so it should "just work"... blame being tired ;) Hmmm I'm not sure why you may be getting no sound, I'll check it in Ubuntu too.
  • This one is a puzzle... the only thing I can say is try setting a scale transformation too. Maybe it only works if you scale AND rotate (a scale of one should keep it the same size). Again looks like a bug that was overlooked.
  • That's a probem with debug in linux(maybe Ubuntu specifically).I'm not sure what exactly causes the slowdown, but if you run it in release mode, it will be fine. My advice is to do a release build if you need to check time critical things, and debug mode if you actually need to debug. Although I have been trying to see what exactly causes the slowdown in debug mode, under linux. I have a hunch about what it is though. Try commenting out the status bar updates in Engine.cpp.
Also thanks very much for the quickstart guide, it would be a good thing to add to the project wiki. I've been very busy last few days, I'm hoping to get some stuff done tomorrow! phew.
 
Last edited by a moderator:
PokeParadox said:
  • This one is a puzzle... the only thing I can say is try setting a scale transformation too. Maybe it only works if you scale AND rotate (a scale of one should keep it the same size). Again looks like a bug that was overlooked.
  • That's a probem with debug in linux(maybe Ubuntu specifically).I'm not sure what exactly causes the slowdown, but if you run it in release mode, it will be fine. My advice is to do a release build if you need to check time critical things, and debug mode if you actually need to debug. Although I have been trying to see what exactly causes the slowdown in debug mode, under linux. I have a hunch about what it is though. Try commenting out the status bar updates in Engine.cpp.
Thanks for the hints! Release mode definitely fixed my slow-down problem.

By setting a scale do you mean :sprite.setScaleX(1) and sprite.setScaleY(1)? That seemed to cause it to draw once, but not thereafter. Basically, I have a rectangularly shaped arm which I want to rotate like a baseball/cricket pitcher "winding up." Something along these lines:

a fragment of update():
QUOTE

if(bvState == BV_WINDUP) {
armAngle += armIncrement;
if (armAngle >= ARM_ANGLE_MAX || armAngle <= 1)
armIncrement = -armIncrement;
//TODO rotate arm & logo
arm.setScaleX(1);
arm.setScaleY(1);
arm.setRotation(0.0174 * (float)armAngle); //radians
}




I'd appreciate any suggestions.

(BTW, I'm going to be out camping this weekend, not ignoring you!)

--Todd
 
Last edited by a moderator:
todd said:
Thanks for the hints! Release mode definitely fixed my slow-down problem.

By setting a scale do you mean :sprite.setScaleX(1) and sprite.setScaleY(1)? That seemed to cause it to draw once, but not thereafter. Basically, I have a rectangularly shaped arm which I want to rotate like a baseball/cricket pitcher "winding up." Something along these lines:

I'd appreciate any suggestions.
(BTW, I'm going to be out camping this weekend, not ignoring you!)
Glad it's not something else that I have to fix! ;)

Yes those functions should prevent the scale becoming messed up. I'll change it to default to a scale of one

Whoops my bad, I told you the angle is in radians... I must have had something else on my mind... I doublechecked the SDL docs and it's definitely in degrees! So sorry. take out the radians conversion and hopefully it will work properly... hopefully. I'll do some test later tonight.

Well I have some time to catch up with things I need to get done then!
 
Last edited by a moderator:
PokeParadox,

That was it! I should have tried degrees anyhow. The rotate works great -- if I set the scale. I can deal with that.

One minor (but annoying) issue probably concerns my CodeBlocks setup as much as anything: when I quit the game framework, it hangs and I have to kill -9 it.

That should give me all pieces I need to finish up my game next week! Well, excepting sound. :)

Thanks again.

--Todd
 
Glad that fixed the issue. If you are trying to quit by the X box... that's currently not working, I'll look into that. It's supposed to work if you are on a PC!

currently the clean way to exit the game is to get back to the menu and quite from there. Another save way would be to add a key combo into your minigame inputHandler function. and call nullifyState() when the key combo is pressed.

Anyway I'm adding in scoring and hiscore tables. I also get the credits screen going. I'm just adapting the ones from CromoZome.
 
QUOTE
I included the spelling competition by pstudio, thanks! I also made sound work and noticed your comments on the timers! I'll look into it! I will do more work through the week, but now I really must sleep! Thanks guys, we can do this!

About the timer issue, I just found it a bit limiting at the time. There isn't really any reason for not letting the artist/programmer decide the fps of the animations.

QUOTE
Should there be an escape key to quit a mini-game? If so, which one should be standard across games? There was one in SpaceInvaders (it works out to the right shift key on my , so I left it in my game. But I noticed it missing from the Spelling Bee.

The reason there isn't an escape key in the Spelling game is because, there hasn't been any definitions on whether there should be one or not. And frankly I don't find an escape key necessary for a 6 seconds mini game ;)
But if there are some special requirements the mini game have to fulfill it would probably be a good idea to get them defined now.

QUOTE
The Spelling bee, by the way pstudio, is hilarious. Your animations are very amusing. The boy vs. girl thing is funny. Is it a comment on the anticipated majority user of the first run Pandoras? :)

He he I should probably be carful about what I write, but it just seemed natural to play the good boy against the little annoying girl :p

QUOTE
If you're starting from scratch, you're ready to go to it! I started out by playing with the SpaceInvaders game to see how things worked, eventually changing pretty much all of it but appreciating the framework it provided. Thanks, pstudio!

Your welcome but to be fair I started out by looking at zacaj's mini game.
 
pstudio said:
QUOTE
I included the spelling competition by pstudio, thanks! I also made sound work and noticed your comments on the timers! I'll look into it! I will do more work through the week, but now I really must sleep! Thanks guys, we can do this!

About the timer issue, I just found it a bit limiting at the time. There isn't really any reason for not letting the artist/programmer decide the fps of the animations.

QUOTE
Should there be an escape key to quit a mini-game? If so, which one should be standard across games? There was one in SpaceInvaders (it works out to the right shift key on my , so I left it in my game. But I noticed it missing from the Spelling Bee.

The reason there isn't an escape key in the Spelling game is because, there hasn't been any definitions on whether there should be one or not. And frankly I don't find an escape key necessary for a 6 seconds mini game ;)
But if there are some special requirements the mini game have to fulfill it would probably be a good idea to get them defined now.

I wanted to keep things simple and you can have 15,30 and 60 fps... which is fine for most purposes, but the functionality there if you need a custom frame delay value now.

I don't think there are anything special. I spoke to ED recently and things for the joystick aren't finalised in the sdl libs, so this is why the escape button will have to be set later :S Just don't worry about it.
minigames just have to have a pass or fail outcome... and be quite short! That's it!
 
Last edited by a moderator:
PokeParadox said:
I wanted to keep things simple and you can have 15,30 and 60 fps... which is fine for most purposes, but the functionality there if you need a custom frame delay value now.

I know it was just to keep things simple and I wasn't complaining, but I'm not an artist and I would be struggling to make 15 fps animations. :lol:

QUOTE

I don't think there are anything special. I spoke to ED recently and things for the joystick aren't finalised in the sdl libs, so this is why the escape button will have to be set later :S Just don't worry about it.
minigames just have to have a pass or fail outcome... and be quite short! That's it!
Ok. Do you know anything about the touchscreen? Will it be like a mouse in SDL or hasn't that been finalised either?

Anyway, unfortunately I won't be working on mini games for the next week or two due to rl, but I'm looking foreward to see plenty of mini games when I return :D
 
Last edited by a moderator:
Hello,
I have minigames I'd like to port from the DS
my little stuff

I tried to install the codeblocks gp2x on 2 win machines
and it failed saying "ERROR: codeblocks-mingw-setup.exe deos not exist "
in a popup.

Can I use my own codeblocks with latest sdl?
( trying this right now )

Moreover, what release date should we aim at ?
( so that I organize my port work )

This looks really neat as a project I really want to contribute B)
 
trabitboy said:
Hello,
I have minigames I'd like to port from the DS
my little stuff

I tried to install the codeblocks gp2x on 2 win machines
and it failed saying "ERROR: codeblocks-mingw-setup.exe deos not exist "
in a popup.

Can I use my own codeblocks with latest sdl?
( trying this right now )

Moreover, what release date should we aim at ?
( so that I organize my port work )

This looks really neat as a project I really want to contribute B)



Welcome trabitboy, funny looking game in the vid! im not nearly there yet.

But since i struggled a bit to get it working myself i can help with installing: if you download the latest codeblocks release with mingw here for instance and put it in the same directory as the gp2x stuff, and then rename it to codeblocks-mingw-setup.exe, everything should work.

Cheers!

Edit: Spelling
 
Last edited by a moderator:
MarkoeZ said:
But since i struggled a bit to get it working myself i can help with installing: if you download the latest codeblocks realease with mingw here for instance and put it in the same directory as the gp2x stuff, and then rename it to codeblocks-mingw-setup.exe, everything should work.




thank your for quick answer:
I'll try this this weekend ;)
 
Last edited by a moderator:
Read the readme for the Code::Blocks GP2X SDK setup. We have it there for a reason.
 
Again a little status update. Added prelim hi-scores table for the random PandoraPanic mode. I'll tidy it up hopefully tomorrow... a framework update might be on Monday because I'll be busy with work over the weekend :S
 
Thanks to my new found expertise at, er, opening C::B and clicking Build, I can provide you with a (resized) screenshot.

shootthealien.jpg


It's the least, and the most, I can do.
 
Well, I may be able to make some music for this.

What would you be looking for exactly? I mean, would you want different little bits of music for each game like warioware or what?

I'd be happy to try and help, just need to know what kind of thing you want :)
 
Due to the nature of the game all that is needed is short snippets of music.
We currently have pretty much nothing... :D

so somethings that are needed are
Title screen music,
short winning music,
short losing music,
credits music,
You got a hi-score music,
hi scores screen music,
minigames themselves.
woo! so if you need a build or anything else I'll gladly provide it. Obviously I'm not expecting you to do everything in that list, but if you can fill in a few blanks it would be great!

Status Update: almost ready for another framework update. (working hi-scores tables and credits screens... couple of bug fixes)
 
Back
Top