Sprite Movement Done Right

Your browser needs java to view projects. Click here to install Java.

user_icon archmage shared it 1 year, 11 months ago
user_icon Based on archmage's project
2924 views, 3 taggers, 61 people love it, 1024 downloads, in 22 galleries
Add to my favorites?
Flag as inappropriate?

Comments

You need to be logged in to post comments

Add a Comment

 
fmasroor fmasroor 2 weeks, 6 days ago

Hey, where can I download 1.2?

pspdude40 pspdude40 3 weeks, 3 days ago

This is an amazing and epic project. YAY!

Crusher44 Crusher44 1 month, 1 week ago

Archmage! You have the old comment block!

RHY3756547 RHY3756547 1 month, 1 week ago

I got stuck in the black platform.

korza4 korza4 1 month, 3 weeks ago

sweet!

fredbarbarosa fredbarbarosa 2 months, 1 week ago

AWESOME! Thanks! And Scratch Jr is a GREAT project!!!

Ideadude1999 Ideadude1999 2 months, 2 weeks ago

You really are the most talented guy in scratch. :)

Ideadude1999 Ideadude1999 2 months, 2 weeks ago

Good to know :)

nevit nevit 2 months, 3 weeks ago

Nice... may be I need it one day...

bombo bombo 2 months, 3 weeks ago

wow.thats....cool!.

sutdude sutdude 3 months ago

MY FREAKING SPRITE WONT MOVE LEFT OR RIGHT WITH THESE SCRIPTS!

sutdude sutdude 3 months ago

Wait but now I removed the and and the abs of xvelocity and deleted max speed and now it works good!

sonny161 sonny161 3 months, 3 weeks ago

how do you add comments?

fg123 fg123 3 months, 3 weeks ago

the sprite goes right into the ground. any way to prevent that?

archmage archmage 3 months, 3 weeks ago

Yes, see my other project sprite movement done perfect.

Zapdos2000 Zapdos2000 4 months, 2 weeks ago

This REALLY helps, but what if I don't want to be able to go through black?

archmage archmage 4 months, 2 weeks ago

see perfect sprite movement

Burp80 Burp80 6 months, 3 weeks ago

Also, instead of making a maximum speed, make a maximum effort variable, and weigh it against air drag, water drag, and ground drag (ouch). What I am wondering is how to avoid spending hours putting things into a single sprite's if box to get many sprites that all must move to interact with every other sprite. That is a reason to want tags to tag sprites with, so each sprite of a certain type can be identified that way in IF blocks.

archmage archmage 6 months, 3 weeks ago

Try asking in the forums

Burp80 Burp80 6 months, 3 weeks ago

Oi! Still goes inside the walls. I have an idea for fixing this. Compose all the walls of one image, then underline it with four sprites for each of the four sides of each of the platforms or whatever in the project. Have everything lose or reverse velocity when hitting a certain wall side with a certain type of velocity, max 2 types of velocity of the 4 easily possible in Scratch. An example: the left sides of both the platforms would be one sprite, to make coding easy in limited Scratch progr.

archmage archmage 6 months, 3 weeks ago

Here is a more advanced version that has what you are looking for. (link to project)

ActionCat210 ActionCat210 6 months, 3 weeks ago

And how do you make sprites solids ?

ActionCat210 ActionCat210 6 months, 3 weeks ago

What does the "abs" mean under the numbers category , cause sitting here saying "WTH does abs mean"?

ActionCat210 ActionCat210 6 months, 4 weeks ago

I need some help cause I'm working on two games Super Smash Bros Brawl 1 (1 cause theres gonna be more) Sonic the Hedgehog And the most imporant thing I've done so far is start preparing the Sprites (mainly costumes for the Sonic game.)But help is needed cause I downloaded this project (should of put it on my flash drive , so I have help to refer to , but I didnt.) So leave a comment on my New World Man project , for some help and what you think of it.Thanks , later : ]

BoltBait BoltBait 6 months, 4 weeks ago

I have a question for you. Let's say you had 2 Cat sprites. How could you get them to bounce off each other as if they were solid? I've got some ideas, but everything I've tried doesn't quite work out the way it should.

BoltBait BoltBait 7 months ago

Thanks for writing this. I refer to it all the time. I've used these formulas in my latest (link to project) and another project that I'm helping someone else write.

boogernator boogernator 7 months, 2 weeks ago

you need to do it on one point three.PLZ I IS BEGGIN NOW!!!!

archmage archmage 7 months, 2 weeks ago

Just copy the scripts in the background.

darters700 darters700 8 months ago

what the heck is that, cds56?

cds56 cds56 9 months, 1 week ago

good. theres no wall sensing. thebirdisthewordthebirdistheword wallsensingisthewordwallsensingisthewordwallsensingistheword

yambanshee yambanshee 9 months, 2 weeks ago

never mind about the ABS.

zawicki1fromyoutube zawicki1fromyoutube 7 months, 2 weeks ago

My brother has abs! :D XD

(view all replies)
yambanshee yambanshee 9 months, 2 weeks ago

Great seeing you trying to teach people. Any change you could explain why the use of abs? what diffrence does it make to the script? Slightly off topic, but what's you NG user, so i could view some of your movies

archmage archmage 9 months, 2 weeks ago

I don't have a lot of stuff on ng my user is archmage-flash

person2 person2 10 months ago

Wow. I made sprite movement like this with velocity, but this is much better and more elaborate than mine. Did you use Flash to make this?

archmage archmage 10 months ago

I made it in scratch. In the background you can see the programming.

(view all replies)
O-man O-man 10 months, 3 weeks ago

Sweet movement! the programming seems to be very afficient and there are only 2 glithches that I could find. Going through the ground and getting stuck in the area where the ground isn't.

Daedname17 Daedname17 10 months, 4 weeks ago

It's not completely done right. You can get stuck in the block.

archmage archmage 10 months, 4 weeks ago

It is the best you can do with a single sprite. I think you may prefer this one (link to project)

(view all replies)
smarter smarter 10 months, 4 weeks ago

Archmage, We Have An Emergency, Please Come To This Chatbox, It's Scrolling Problems : http://javascriptrpg.webs.com/Gaming.htm

funnyman1120 funnyman1120 10 months, 4 weeks ago

also how would you do this with scrolling

yambanshee yambanshee 9 months, 2 weeks ago

exactly the same, but instead of changeing the X and Y, change the scroll X and Y (may need to use something like *-1 t change it to a negative number)

funnyman1120 funnyman1120 10 months, 4 weeks ago

can you tell me how to double jump

hippiegirl hippiegirl 11 months, 1 week ago

Sorry . . . can u tell me how to flip a sprite?

Joshamo Joshamo 1 year ago

I don't get how people can get the sprites look just like the scripts. HOW DO THEY DO IT? Please reply and tell me the answer

zawicki1fromyoutube zawicki1fromyoutube 1 year ago

you do it on the script area. not the script.

zawicki1fromyoutube zawicki1fromyoutube 1 year ago

YOU RIGHT CLICK (or ctrl click) AND THEN CLICK "SAVE PICTURE OF SCRIPTS".

(view all replies)
person2 person2 1 year, 1 month ago

Wow. How do you invent this stuff!? It's amazing!

archmage archmage 1 year, 1 month ago

I programmed this before in flash

(view all replies)
boberjoe4 boberjoe4 1 year, 1 month ago

HELP! i have looked really carfully and made sure my script is JUST like yours, but my character always slides to the right without stopping unless i hole down the left arrow, which of course makes him move to the left. so jumping and left movement are fine but not the right one, could you help?

Ian700A Ian700A 1 year, 1 month ago

I know. you need to put POINT Zero Nine 0.9. under set xvelocity x 0.9. rember, 0.9 not 9. hope this helps! :)

archmage archmage 1 year, 1 month ago

If all else fails, just download this project and export the main sprite. Then import the sprite into your own project.

(view all replies)
archmage archmage 1 year, 1 month ago

The version doesn't matter. If your project acts diffrently than this one it is because your script is diffrent.

(view all replies)
archmage archmage 1 year, 1 month ago

You did something wrong. Make sure that all the numbers are correct.

(view all replies)
logan996 logan996 1 year, 1 month ago

hey, so you made the scratch lessons on wikibooks?

animator123 animator123 1 year, 2 months ago

look what i did with your moving script archmage!!!! (link to project)

animator123 animator123 1 year, 2 months ago

hey why do you have to make a variable maxspeed if its forever 20. Can't u just do (if abs of xvelocity< 20)

madscientist113 madscientist113 11 months, 2 weeks ago

you might also want to change it so that you can like make a speed round or something

archmage archmage 1 year, 2 months ago

It's easier to change if its a variable.

(view all replies)
animator123 animator123 1 year, 2 months ago

archmage do u mind if i use this in my project I'm not good with gravity and all that stuff Thanks!

archmage archmage 1 year, 2 months ago

I put it here for people to use :)

(view all replies)
Gamefancomedy Gamefancomedy 1 year, 2 months ago

THanks Rchamge, I thought I would say thanks as you taught me how to scroll aswell, thanks for being helpful!

archmage archmage 1 year, 2 months ago

Being helpful is what I do :)

keroro645 keroro645 1 year, 2 months ago

ABS is the absolute value of something.Or i think

archmage archmage 1 year, 2 months ago

You are correct

kochu kochu 1 year, 2 months ago

I also want to know what "ABS" means

archmage archmage 1 year, 2 months ago

The purpose of the abs block is this is simple as well. Since the xVelocity can be a negative number if you want to move the sprite to the left using if (xVelocity>maxVelocity) is no longer an effective way to limit the sprite's movement. To fix this we make sure that the xVelocity variable is always positive.

archmage archmage 1 year, 2 months ago

I already said what it does. Ok, let me give you an example. Say we use abs on the number -5. It would look something like this abs(-5). Abs(-5) is equal to five. Abs(5) is also equal to five. Really simple concept once you understand it.

henley henley 1 year, 2 months ago

what does "abs" mean/do?

archmage archmage 1 year, 2 months ago

It makes numbers positive.

(view all replies)
henley henley 1 year, 2 months ago

U ROCK!!!!!!!!!!!!!!!!

zezima1 zezima1 1 year, 2 months ago

some one please tell me how you can download it!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

zezima1 zezima1 1 year, 2 months ago

how do you download it??

archmage archmage 1 year, 2 months ago

Look to the right of the project.

(view all replies)
matthewjose matthewjose 1 year, 2 months ago

BIG GLITCH I exactly copied the scripts at the back to Scratch....then it doesnt do anything! it onl jumps but horribly!

matthewjose matthewjose 1 year, 2 months ago

Oh it works now! I used it on my Space Wars game, almost out. Thanks alot =)

matthewjose matthewjose 1 year, 3 months ago

Or......are the scripts on the screen on the cat........

archmage archmage 1 year, 3 months ago

Yes, the scripts on the screen are on the cat.

matthewjose matthewjose 1 year, 3 months ago

I mean, you said there was help w/ JUMPING here, too.

archmage archmage 1 year, 3 months ago

Yes, the script in the background picture is for jumping and other movement.

matthewjose matthewjose 1 year, 3 months ago

Then what are the scripts on the cat(main sprite)?

archmage archmage 1 year, 3 months ago

Download the project to look at the scripts in the cat sprite.

(view all replies)
Nerdynerd911 Nerdynerd911 1 year, 3 months ago

I'm going to make a scratch project using the comment block from this project. I'll duplicate it and give you credit.

animator123 animator123 1 year, 3 months ago

i dont get it

animator123 animator123 1 year, 3 months ago

oh yeah from the old version of scratch

zawicki1fromyoutube zawicki1fromyoutube 1 year, 3 months ago

welcome.

zawicki1fromyoutube zawicki1fromyoutube 1 year, 3 months ago

no, they are variables. i get red variables, and i have version 1.2.

(view all replies)
animator123 animator123 1 year, 3 months ago

how did you get the red blocks!!!

animator123 animator123 1 year, 3 months ago

IT WONT LOAD!!! very cool though!

kitten22 kitten22 1 year, 3 months ago

i'll try

catdoghamster catdoghamster 1 year, 4 months ago

if, my bad. oh archmage? how uh, do you make shooting?

archmage archmage 1 year, 4 months ago

CHeck this out (link to project)

catdoghamster catdoghamster 1 year, 4 months ago

i it scrolls, just don't make an x velocity

gnomick gnomick 1 year, 5 months ago

I am currently making a side-scrolling game and I need help beacuse with the X velocity value, the player sprite moves and extremely fast speed and hides into nowhere, even though the script is exactly the same. Can anybody help, please?

Please Wait...