00:00
00:00
Newgrounds Background Image Theme

Sadotakuu just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

AS: Basic Movement

32,799 Views | 92 Replies
New Topic Respond to this Topic

Response to AS: Basic Movement 2005-08-24 12:16:54


what if you want it when you aren't pressing any keys to gotoAndPlay something else?

Response to AS: Basic Movement 2005-08-24 12:18:52


after all you keypresses are checked and an else goto and play blah.


These new signatures can suck on mah balls. My lolis don't fit in. Lol wut what are you guys still doing on NG, move on.

BBS Signature

Response to AS: Basic Movement 2005-08-27 21:39:49


At 2/10/05 05:15 PM, -JParadox- wrote: Denvish.

My anti drug.

Sweet job man, I learned a few things myself.

I hope this and your many other text tutorials help all in need.

My anti Drug Too!

Response to AS: Basic Movement 2005-09-27 20:18:56


so where do i put

onClipEvent(load){
speed=10; stop();
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)){_x+=speed; gotoAndStop(1);}
if (Key.isDown(Key.DOWN)){_y+=speed; gotoAndStop(2);}
if (Key.isDown(Key.LEFT)){_x-=speed; gotoAndStop(3);}
if (Key.isDown(Key.UP)){_y-=speed; gotoAndStop(1);}
}

Response to AS: Basic Movement 2005-10-03 16:59:16


freaken thanks man. i only ask how to keep the mc from leaving off screen.

Response to AS: Basic Movement 2005-10-06 15:57:30


Put the MC on the stage and add these actions:
onClipEvent(load){
speed=10; stop();
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)){_x+=speed; gotoAndStop(1);}
if (Key.isDown(Key.DOWN)){_y+=speed; gotoAndStop(2);}
if (Key.isDown(Key.LEFT)){_x-=speed; gotoAndStop(3);}
if (Key.isDown(Key.UP)){_y-=speed; gotoAndStop(1);}
}

Little problem there, : if (Key.isDown(Key.UP)){_y-=speed; gotoAndStop(1);} shouldn't that be if (Key.isDown(Key.UP)){_y-=speed; gotoAndStop(4?);} ?

Response to AS: Basic Movement 2005-10-07 15:04:35


At 2/10/05 06:34 PM, Denvish wrote: Basic side-scroller (walking) movement

The variable 'dir' just holds the direction in which the character is moving, so he knows which direction to face when stopped

onClipEvent(load){
speed=10; stop(); dir=0;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)){
_x+=speed; gotoAndStop(2); dir=0;
}else if (Key.isDown(Key.LEFT)){
_x-=speed; gotoAndStop(3); dir=1;
}else{
if (dir==0){
gotoAndStop(1);
}else{
gotoAndStop(4);
}
}
}

Pretty cool, could you make one with a four-directions movement?
That would be pretty cool =)

Response to AS: Basic Movement 2005-10-08 09:09:12


Want your character (top-down) to point in his movement direction when he stops?
I posted this code as a response to this thread, thought I may as well post it here too.

Your frames should be
1: right, moving - 2: down, moving - 3: left, moving - 4: up, moving
5: right, standing - 6: down, standing - 7: left, standing - 8: up, standing

onClipEvent(load){
speed=10; stop(); dir=1;moving=0;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)){moving=1; dir=1;}
else if (Key.isDown(Key.DOWN)){moving=1; dir=2;}
else if (Key.isDown(Key.LEFT)){moving=1; dir=3;}
else if (Key.isDown(Key.UP)){moving=1; dir=4;}
else{moving=0;}
if(moving){
gotoAndStop(dir);
}else{
gotoAndStop(dir+4);
}
}


- - Flash - Music - Images - -

BBS Signature

Response to AS: Basic Movement 2005-10-26 23:53:52


I'm trying to make a NG halloween dress-up game, and I can click on the objects, but cant drop them. I need the stop drag code part of it. I went to kirupa.com, and got the code, but the stop drag code part won't work. Thanks in advance.

Response to AS: Basic Movement 2005-10-26 23:58:45


At 10/26/05 11:53 PM, Propane_Clock wrote: I'm trying to make a NG halloween dress-up game, and I can click on the objects, but cant drop them. I need the stop drag code part of it. I went to kirupa.com, and got the code, but the stop drag code part won't work. Thanks in advance.

you came to the wrong thread, darling...
try here: AS: Drag and Drop.
if i may ask, what made you come to AS: Basic Movement to ask that question?
that makes less sense than making a new thread about your question when AS: Main holds all your answers.


BBS Signature

Response to AS: Basic Movement 2005-11-13 01:13:57


At 2/10/05 06:36 PM, Denvish wrote:
At 2/10/05 06:34 PM, Denvish wrote: Basic side-scroller (walking) movement
That snippet assumes that frame 1 is stationary facing right, frame 2 is moving right, frame 3 is moving left, frame 4 is stationary facing left. Don't ask why they're in that order... ;)

how do you make it shoot and kill an enimy


Yummy

BBS Signature

Response to AS: Basic Movement 2005-11-13 01:15:33


At 7/14/05 05:45 PM, Fbi-bp wrote: i learnd alot in this topic. thx

how you make it shoot


Yummy

BBS Signature

Response to AS: Basic Movement 2005-12-20 16:25:05


At 10/8/05 09:09 AM, Denvish wrote: Want your character (top-down) to point in his movement direction when he stops?
I posted this code as a response to this thread, thought I may as well post it here too.

Your frames should be
1: right, moving - 2: down, moving - 3: left, moving - 4: up, moving
5: right, standing - 6: down, standing - 7: left, standing - 8: up, standing

onClipEvent(load){
speed=10; stop(); dir=1;moving=0;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)){moving=1; dir=1;}
else if (Key.isDown(Key.DOWN)){moving=1; dir=2;}
else if (Key.isDown(Key.LEFT)){moving=1; dir=3;}
else if (Key.isDown(Key.UP)){moving=1; dir=4;}
else{moving=0;}
if(moving){
gotoAndStop(dir);
}else{
gotoAndStop(dir+4);
}
}

I wanna do something final fight like....it all seems good and works in the right directions except left down which i'd want as the left walking motion.... also someone posted a wall AS on one of these boards but it doesn't seem to work when i imput it and i'm not sure what it is.... theres alot of other things i need to find/figure out for my streets of rage style game but these two things that i presented are the things that are effecting me the most.....

Response to AS: Basic Movement 2006-01-02 11:23:31


great man!! i can finaly make a simple game with this...


If a man that always tells the truth comes up to you and says that another man always tells lies, and the man who always lies come up to you and says "I'm lying", then is he?

BBS Signature

Response to AS: Basic Movement 2006-01-03 18:30:53


Rhinan wanted to know how to make buttons.
Do this:
Draw a button. Go to Insert>convert to symbol.
Name it anything!
Right click>actions

Paste this code for a game:
on (press) {
nextFrame();
}

This for a movie:
on (press) {
play();
}

Those are play buttons. You can change the action by deleting the bold. And typing in something else

on (press) {
nextFrame();
}

Response to AS: Basic Movement 2006-01-03 18:33:38


damn, this is useful.

Response to AS: Basic Movement 2006-02-20 08:33:29


im new to flash

i have got the movement working-- but i need to get my person to jump using space bar
i kno you proberly thinking OMG another beginer asking for stupid easy help..

so could you help me please..

Response to AS: Basic Movement 2006-02-20 08:37:16


At 2/20/06 08:33 AM, Evil-Entety wrote: im new to flash

i have got the movement working-- but i need to get my person to jump using space bar
i kno you proberly thinking OMG another beginer asking for stupid easy help..

so could you help me please..

If you have read the first post a few more times and try things out with it you would have found out yourself.

If you wish to use the WASD keys, the keycodes are:

At, some moment, Devish wrote:

WASD -- ARROWS -- A.KEYS
- (68) ------ (39) ------ (Key.RIGHT)
- (65) ------ (37) ------ (Key.LEFT)
- (87) ------ (38) ------ (Key.UP)
- (83) ------ (40) ------ (Key.DOWN)

Use them like this:
_x+=Key.isDown(39)
or
if (Key.isDown(39)){_x+=speed;}

Other useful ones:

SPACE -------- (32)
ALT ------------ (18)
ENTER -------- (13)
BACKSPACE --- (8)
SHIFT --------- (16)
Z --------------- (90)
X --------------- (88)
C -------------- (67)

Response to AS: Basic Movement 2006-02-20 08:39:39


thanks

Response to AS: Basic Movement 2006-02-20 10:42:19


i added something to ur code denvish but if i hit the arrow key twice in a row it'll play dir 1 or whatever. (i.e. i hit right, it plays fraem4, i let up and hit it agin, i now plays frame 1)

onClipEvent(load){
speed=5; stop(); dir=1; olddir=1;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)){moving=1; dir=1;}
else if (Key.isDown(Key.DOWN)){moving=2; dir=2;}
else if (Key.isDown(Key.LEFT)){moving=3; dir=3;}
else if (Key.isDown(Key.UP)){moving=4;dir=4;}
else{moving=0;}

if(moving){
_x += (dir == 1 ? speed : dir == 3 ? -speed : 0);
_y += (dir == 2 ? speed : dir == 4 ? -speed : 0);

if(dir!==olddir){
gotoAndStop(dir);
}
}else{
gotoAndStop(dir+4);
}
olddir=dir;
}

any help?


Hello, from the past!

[ PHP: Main ]

BBS Signature

Response to AS: Basic Movement 2006-02-20 11:06:40


I think AS: Main now needs an uber basic section :P

Response to AS: Basic Movement 2006-03-12 19:35:46


which one is the one for side scrolling with orientation???

Response to AS: Basic Movement 2006-03-16 14:57:00


this is not working for me... help please

Response to AS: Basic Movement 2006-04-02 11:07:42


does anyone has a code for collision walls , you see i used this code from the denvish archives (yes i call it that , i am a fan)

Left, right, down, up movement with orientation

Create a new MC with 4 frames.
On the first frame, add your character walking right.
On the second frame, add your character walking down.
Third frame, left. Fourth frame, up.

Put the MC on the stage and add these actions:
onClipEvent(load){
speed=10; stop();
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)){_x+=speed; gotoAndStop(1);}
if (Key.isDown(Key.DOWN)){_y+=speed; gotoAndStop(2);}
if (Key.isDown(Key.LEFT)){_x-=speed; gotoAndStop(3);}
if (Key.isDown(Key.UP)){_y-=speed; gotoAndStop(1);}
}

---------------------------------

now can someone give me a collision wall code because i am like making a room blah blah and stuff so....CODE ME UP SCOTTY !

Response to AS: Basic Movement 2006-04-05 15:59:33


sweet thanks

Response to AS: Basic Movement 2006-04-08 05:37:39


How do I get something to walk with the WASD keys


Get Fuckle'd

BBS Signature

Response to AS: Basic Movement 2006-04-09 10:27:25


this tells you every scancode for every key on the keyboard.

Actionscript keycodes

A
65

B
66

C
67

D
68

E
69

F
70

G
71

H
72

I
73

J
74

K
75

L
76

M
77

N
78

O
79

P
80

Q
81

R
82

S
83

T
84

U
85

V
86

W
87

X
88

Y
89

Z
90

0
48

1
49

2
50

3
51

4
52

5
53

6
54

7
55

8
56

9
57

Backspace
8

Tab
9

Clear
12

Enter
13

Shift
16

Control
17

Alt
18

Caps Lock
20

Esc
27

Spacebar
32

Page Up
33

Page Down
34

End
35

Home
36

Left Arrow
37

Up Arrow
38

Right Arrow
39

Down Arrow
40

Insert
45

Delete
46

Help
47

Num Lock
144

; :
186

= +
187

- _
189

/ ?
191

` ~
192

[ {
219

\ |
220

] }
221

" '
222

Response to AS: Basic Movement 2006-04-16 14:58:50


What are all these numbers and letters?? Is this for Macromedia Flash 8?? Can Someone explain clearly?


All Eyez On Me.

BBS Signature

Response to AS: Basic Movement 2006-05-12 12:04:27


hello

Response to AS: Basic Movement 2006-05-12 12:05:40


Ah, dude, just use the documentation!


BBS Signature