The Armor Games website will be down for maintenance on Monday 10/7/2024
starting at 10:00 AM Pacific time. We apologize for the inconvenience.

ForumsProgramming ForumSprite with Movement code

52 15715
Midmenj
offline
Midmenj
216 posts
Nomad

Hello, I have a working code with working sprites. But I'm trying to figure out how to make him stop moving when i don't hold down the key.
Here is the code:

onClipEvent (load) {
walk = 4;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
gotoAndStop(1);
_x += walk;
} else if (Key.isDown(Key.LEFT)) {
gotoAndStop(2);
_x -= walk;
} else {
gotoAndStop(1);
}
}

Just to recap I want the character to stop moving in the direction he was going.

Thank you

  • 52 Replies
Midmenj
offline
Midmenj
216 posts
Nomad

I'll probably learn this stuff later in the year, I'm in college for Game Design so I am learning C++ not action script. I am just trying to learn about this stuff.

beech
offline
beech
107 posts
Nomad

right on M - that's the whole point right

also, the way that all the different languages work is very similar, what really only changes is the syntax

i would like to see what you have so far, if there is any way you can post your file that would be great.

Midmenj
offline
Midmenj
216 posts
Nomad

How do i post it? if you tell me how i will

beech
offline
beech
107 posts
Nomad

cool - well you have to have access to a server, or use a third party service - i could possibly set up a FTP for you on mine - however i'm quite busy atm - i would assume that your College has some type of server access, weather that is available for you to use is another question - lol

if you did have host server access (or even your ISP usually provides space) you'd compress the file .zip and then upload - posting a link here to the address of the file

unfortunately it seems that there is no way to upload files on this BB - as far as i can tell

plasmafish
offline
plasmafish
252 posts
Nomad

... so you were just trying to show off?


Sorry, I didn't think that's how I came across.

Looking back one page it seems that you answered my original question for midmen. I'll leave you two alone.
beech
offline
beech
107 posts
Nomad

accepted. your thoughts or opinions are as valid as anyones.

however if you had read the previous pages you would have known what the OP was working on, where they were at in the process, and what had been offered.

Midmenj
offline
Midmenj
216 posts
Nomad

what's your email, i'll just email it to you, cause I dont know how to send it via this hahaha

Showing 46-52 of 52