Discuss Scratch

EpicGamer50
Scratcher
1 post

How Do You Make A Sprite Not Go Through Walls?

monkboyeli wrote:

deck26 wrote:

OK, I see how the next room parts work. The problem was I'd changed the costume for the LevelOneSets sprite and it doesn't make sure that you start with the right costume for that sprite when it first appears.

I would urge you to sort out your general movement first before dealing with anything else. For example, jumping is not just a case of having a costume with the centre offset so the sprite appears to go up. Once the jump is over it has no way of landing on something but nor can it move right or left while jumping.

You really ought to investigate movement using x and y velocities and gravity which makes this easier.
http://wiki.scratch.mit.edu/wiki/Velocity


Actually, I was just fixing the jumping! Although, thank you!
MadiBookWorm
Scratcher
4 posts

How Do You Make A Sprite Not Go Through Walls?

I'm also building something that I need this all for, so thanks!
jromagnoli
Scratcher
1000+ posts

How Do You Make A Sprite Not Go Through Walls?

Use a variable for the x movement, then you can go
iftouchingcolor?thenchangexbyfoo*-1

Powered by DjangoBB