PDA

View Full Version : Platform game with a gun?


ThePearl
09-12-2008, 03:33 PM
Hi there! You might have noticed that I posted this both in AS2 and AS3. That's because I know how to create a basic platform game in both languages but I need help with including a gun.

So, just a 2 or 4 directional gun, like in Cave Story, I wanna be the guy and many many more.

I tried by my own, changing a variable every time you hit a button, for example;


onClipEvent(enterFrame) {
if (Key.isDown(Key.LEFT)) {
left = 1;
right = 0;
_x -= xspeed
}
if (Key.isDown(Key.RIGHT)) {
right = 1;
left = 0;
_x += xspeed
}


Just example code, should work.(?)

senocular
09-12-2008, 03:40 PM
Please keep your questions to one thread : ) Thanks!

I've kept this one because it had more code to work with.

ThePearl
09-12-2008, 03:53 PM
Oh ok, sorry then. Thanks for keeping one ;) had two because I'm thinking of changing to AS3 but I'm not sure, I'll prob. stay at 2 anyway

I'll stay online for a while so keep posting : )

ThePearl
09-12-2008, 09:19 PM
Oh cmon I really need help, can't find anything on the web