|
-
OMG it works!! Thank you very much sir!
I am so new in this programming things and i wan't to learn it. I still have one problem sir . I can't make my character jump. I still can't find the logic to make this work. It is still in Keyboard Event. Can you please translate it to the MouseEvent sir.. It works on the Keyboard event but I can't make it wirk on the jump_btn that i made..
This is the codes of the jump:
var dy:Number=0;
var gravity:Number=1;
var canjump:Boolean = false;
stage.addEventListener(Event.ENTER_FRAME,onenter);
function onenter(e:Event):void{
dy+=gravity;
if (hero.y>300){
dy=0;
canjump=true;
}
if (Key.isDown(Key.UP) && canjump){
dy=-20;
canjump = false;
}
hero.y+=dy;
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
|