This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2008-11-03 19:26:36

TacticalAssassin
Scratcher
Registered: 2008-11-03
Posts: 2

Collision

How can i make a sprite collide with a sprite? AKA creating a platform or simulated ground.

Offline

 

#2 2008-11-03 19:28:15

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Collision

Is this what you have in mind?
http://scratch.mit.edu/projects/archmage/101212


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#3 2008-11-03 22:32:33

yambanshee
Scratcher
Registered: 2007-11-06
Posts: 500+

Re: Collision

one word: sencors. make a sencor with a goust effect of 100 that goes to your sprite's y position, and X + (experament with a couple of numbers, the goal is to have it right infront of the main sprite. The sencor should be a stright line, rather thick and when it touches the colour of a wall, it chages a variable to one, else 0. on the main sprite for the moving controlls, always have it so that you can only move when that variable is 0, and if it is 1, change the sprite's X by -1. now do the same for the other side. as for a floor, if you have a gravity variable, make it so that when its touching the colour of the floor, set gravity to 0, and change y by 1. hope that helps!

Offline

 

Board footer