The Enchanted Cave 2
Delve into a strange cave with a seemingly endless supply of treasure, strategically choos
4.39 / 5.00 38,635 ViewsGhostbusters B.I.P.
COMPLETE edition of the interactive "choose next panel" comic
4.09 / 5.00 15,161 ViewsOk so basicly i know nothing about AS and seeing as nobody wants to help me make my game, im going to try to learn.
how would i write something like:
on press up key move up at speed X
on press right key move right at speed X
on press left key move left at speed X
on press down key move down at speed X
But then for example so you dont walk into the air or ground how would i write,
if "instance name" moves above x=100 do not allow?
Also how do i make it play a certain mc when i press a button, eg when i press right it turns right?
Thanks.
this is to move. put this in a movieclip
onClipEvent (load) {
speed = 6;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.UP)) {
_y -= speed;
}
if (Key.isDown(Key.DOWN)) {
_y += speed;
}
if (Key.isDown(Key.LEFT)) {
_x -= speed;
}
if (Key.isDown(Key.RIGHT)) {
_x += speed;
}
}
At 7/28/09 07:05 PM, Magical-Zorse wrote: this is to move. put this in a movieclip
onClipEvent (load) {
speed = 6;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.UP)) {
_y -= speed;
}
if (Key.isDown(Key.DOWN)) {
_y += speed;
}
if (Key.isDown(Key.LEFT)) {
_x -= speed;
}
if (Key.isDown(Key.RIGHT)) {
_x += speed;
}
}
Thanks, I guess thats self explanatory as in what it does (im trying to learn AS) but why do you have the indent thing on some of the lines but not on the top ones? Does it have to be there for it to work and what button is it?
Thanks, I guess thats self explanatory as in what it does (im trying to learn AS) but why do you have the indent thing on some of the lines but not on the top ones? Does it have to be there for it to work and what button is it?
The indent does itself, it basically makes it easier to check you've done everything right. Don't worry about it, you can auto-format with the format button.