The McLeodGaming forums were permanently closed on April 30th, 2020. You are currently viewing a read-only archive.
View unanswered posts | View active topics It is currently Fri May 15, 2020 1:57 am

Forum rules


IMPORTANT

This Forum is for Flash related questions ONLY! Do not ask questions about spriting, Game Maker, Photoshop, or anything else not related to Flash.



 [ 1 post ] 
Ladders in Flash 
Author Message
User avatar

Joined: Sat Jan 15, 2011 7:30 pm
Posts: 54
Country: Dominican Republic (do)
Gender: Male
MGN Username: Jose_Gabriel
Currently Playing: Last Legacy: Null Space
Hello everybody, I want to make a ladder to a plataform game that I'm making...

AS2 Please Help me :ko:

Here's the code of the characther (somethings are in spanish)

onClipEvent(load) {
var ground:MovieClip = _root.ground;
var grav:Number = 0;
var gravity:Number = 2;
var speed:Number = 10;
var maxJump:Number = -20;
var touchingGround:Boolean = false;
}
onClipEvent(enterFrame) {
_y += grav;
grav += gravity;
while (ground.hitTest(_x, _y, true)) {
_y -= gravity;
grav = 0;
} if(ground.hitTest(_x, _y+5, true)) {
touchingGround = true;
} else {
touchingGround = false;
}
if(Key.isDown(Key.RIGHT)) {
_x += speed;
}
if (Key.isDown(Key.LEFT)) {
_x -= speed;
}
if(Key.isDown(90) && touchingGround) {
grav = maxJump;
}
}

And the actions:

onClipEvent (enterFrame) {
Jugador = _root.jugador;
if (Key.isDown(Key.RIGHT)) {
Jugador._xscale = 100;
Jugador.gotoAndStop("caminando");
} else if (Key.isDown(Key.LEFT)) {
Jugador._xscale = -100;
Jugador.gotoAndStop("caminando");
} else {
Jugador.gotoAndStop("normal");
}
this._visible = false;
}

(EDIT)

Ah, and I want to make a submit score button or something like that :nod:

_________________
Only the will to fight can save us! -Attack on Titan


Mon Jul 09, 2012 12:39 pm
Display posts from previous:  Sort by  
 [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software for PTF.