
Welcome Guest
|
#1
|
||||
|
||||
|
Movement Code
I'm hoping to learn more about making a game. So, I started with the basic movements. This is the code I use.
When you try this code, if you hold the key, it goes continually. What I want to happen 1) When the key is held it won't travel continually. Code:
onClipEvent(load){
distance=48
}
onClipEvent(enterFrame){
if(Key.isDown(Key.UP)){
_y-=distance
}
else if(Key.isDown(Key.DOWN)){
_y+=distance
}
else if(Key.isDown(Key.LEFT)){
_x-=distance
}
else if(Key.isDown(Key.RIGHT)){
_x+=distance
}
} |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| listener not working in my code | test84 | Actionscript 2.0 |
0 | 02-28-2008 05:34 PM |
| Scottae's code...I need some more help please. | lariat1997 | Actionscript 2.0 |
6 | 02-23-2007 07:43 PM |
| add one fabric code on the flash | garyww | Flash MX 2004 |
6 | 09-01-2006 08:14 AM |
| Adobe's code only, still not compiling | saumya | ActionScript 3.0 |
3 | 04-26-2006 03:54 PM |
| Problems with XML code from reference book. | PUP100 | XML & Sockets | 0 | 01-07-2005 12:07 PM |





