0
platform game-using mouse key
Community Beginner
,
/t5/animate-discussions/platform-game-using-mouse-key/td-p/8895932
Mar 08, 2017
Mar 08, 2017
Copy link to clipboard
Copied
hey,
i want to create platform game in as3.
can someone send/write me the code that say: if i press the mouse key the player jump else he stand on the ground.
thanks(-:
TOPICS
ActionScript
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
LATEST
/t5/animate-discussions/platform-game-using-mouse-key/m-p/8895933#M163666
Mar 08, 2017
Mar 08, 2017
Copy link to clipboard
Copied
AS3 relies on event listeners for just about everything. If you want to have something hapen as a result of a mouse interaction then you need to use an event listener for that.
addEventListener(MouseEvent.MOUSE_DOWN, doSomethingDown);
function doSomethingDown(evt:MouseEvent):void {
// put whatever you plan for jumping code here
}
addEventListener(MouseEvent.MOUSE_UP, doSomethingUp);
function doSomethingUp(evt:MouseEvent):void {
// put whatever you plan for stopping the jumping here
}
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

