-
-
-
Hmm.. I'm actually also a n00b, so I probably won't be able to help much, haha but maybe I could try a little bit... Although, maybe it would be better if I didn't since I could confuse with my noobness xD But oh well~
I'm making a mini game and I have two arrows on top, one takes you to the right and the other to the left, so what I did was that I made the background 200x200 and the "map" i made it 1000x200, so there are 5 stages, but they are all on the same frame.
Then this was my code on the main layer:
stop();
var vx:Number = 0;
var vy:Number = 0;
var mainSpeed: Number = 200;
function leftmove(e:MouseEvent):void
{ if(fondo.x<400)
fondo.x += mainSpeed;
}
function rightmove(e:MouseEvent):void
{ if(fondo.x>-200)
fondo.x -= mainSpeed;
}
left.addEventListener(MouseEvent.CLICK, leftmove);
right.addEventListener(MouseEvent.CLICK, rightmove);
In the 1000x200 background it would show only 200x200 on each click, and you wouldn't be able to keep clicking the arrow when the en was reached...
You can also make the background for each level, make each one an object, make the arrow, and on the main timeline add each of the backgrounds on each frame, add the arrow and make it last for all the time and do something like:
stop();
function moveup(e:MouseEvent):void
{
gotoAndStop(2);
}
button.addEventListener(MouseEvent.CLICK, moveup);
and then just change the gotoAndStop(2); to 3, 4, 5 etc... Or maybe you can add a variable that after each click is added... like
var nextlvl: Number = 1;
and then where the gotoAndStop(2); was it would be like
gotoAndStop(nextlvl);
nextlvl=nextlvl+1;
Hmm... I just started using flash so this is probably a really noobish way to do it, but it could give you some ideas
-
Flash/Flex Developer
What version of Flash are you building your game in? It is important to provide sample code.
Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|