What i want is to use buttons to move my character.. In my flash game i made a button, when clicked it will make my
character move.. i don't need to use keyboard movements..
This is my codings actionscript 3.0:
import flash.events.Event;
hero.gotoAndStop('still');
var Key:KeyObject = new KeyObject(stage);
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;
I am making a side scroller game in android.
My character is positioned in the center left of the stage so the user has more of a preview before they encounter an obstacle.
The character can only move to the right, so when it moves to the right the background is scrolling to the left.
I also have the jump button and move button.. I used the codes that you've translated to Mouse Event (above this post)
Also need to make a hurdle movie clip, in the library give it export linkage name of "Hurdle".
Make a health bar movie clip on the stage with instance name of "health".
And change instance name of buttons to match the code.
I did what you told me. I made two movie clips with instance name of "health" and "Hurdle"(Hurdle is also the name at the Library)
Then I changed the name of the codes to jump_btn and pause_btn because that is the instance name of my two buttons.
When i test movie, it has errors.
Scene 1, Layer 'as3', Frame 1, Line 10 1046: Type was not found or was not a compile-time constant: Hurdle.
Scene 1, Layer 'as3', Frame 1, Line 71 1067: Implicit coercion of a value of type flash.display:MovieClip to an unrelated type Class.
Scene 1, Layer 'as3', Frame 1, Line 94 1180: Call to a possibly undefined method Hurdle.
I got it working already.
But there is a problem the two background are overlapping each other, can I just use one background because I have a background already which i made.
Uhmmm sir dawsonk. When I test movie it at first the two background are connected and then after that when the backgrouds show up again it is not already connected, there is a gap in between bgA and bgB. How can I fix that? please sir help.
The two background are now not overlapping but there is a gap in between bgA and bgB. At first the two backgrounds are connected then after that when it loops the two backgrounds have a gap.
Last edited by juliuz0001; 01-18-2013 at 09:35 AM.
Just hold down the right_btn to move then you will get to the point where the obstacle are showing up.
I just use one background. I removed the bgB codes. The problem is i don't know the conditionals to use. It's on function oneneter ad addObj (bgA);
I need to put conditionals on addObj(bgA);
When the obstacles appear it never stops and is very fast. I don't know what conditionals to use.
Just hold down the right_btn to move then you will get to the point where the obstacle are showing up.
The problem is i don't know the conditionals to use. It's on function oneneter addObj (bgA);
I need to put conditionals on addObj(bgA);
When the obstacles appear it never stops and is very fast. I don't know what conditionals to use.
The bgB is for the sky background - The codes on bgB is just movement.