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

#1 2009-11-01 19:17:29

lonwol
Scratcher
Registered: 2008-11-10
Posts: 1000+

Help with colliding!

I need to figure out how to make a script or a topdown scroller where collide with a wall instead of going through it. For scrolling i use like ScrollX, and ScrollY variables.
Please help.


I host servers for money ya?

Offline

 

#2 2009-11-02 00:57:57

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: Help with colliding!

Hi lonwol - the Troubleshooting forum is for reporting bugs. If you need help making a project, please post in All About Scratch. Thanks!

Can you give more information?


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

#3 2009-11-02 09:11:50

MyRedNeptune
Community Moderator
Registered: 2007-05-07
Posts: 1000+

Re: Help with colliding!

Moving to All About Scratch. ^^


http://i52.tinypic.com/5es7t0.png I know what you're thinking! "Neptune! Get rid of those filthy advertisements and give us back the Zarathustra siggy, you horrible person!" Well, don't worry about it, the Zara siggy will be back soon, new and improved! ^^ Meanwhile, just do what the sig tells you to. >.>

Offline

 

#4 2009-11-02 17:14:35

diywid
Scratcher
Registered: 2009-10-27
Posts: 76

Re: Help with colliding!

I am also looking for an answer to the same problem, I think there should be an answer in this thread soon: http://scratch.mit.edu/forums/viewtopic.php?id=25113

Offline

 

#5 2009-11-02 17:21:12

lonwol
Scratcher
Registered: 2008-11-10
Posts: 1000+

Re: Help with colliding!

diywid wrote:

I am also looking for an answer to the same problem, I think there should be an answer in this thread soon: http://scratch.mit.edu/forums/viewtopic.php?id=25113

That guy is one of my best friends but when i tried it out he told me it didn't work in scrollers so idk


I host servers for money ya?

Offline

 

#6 2009-11-09 01:25:10

Locomule
Scratcher
Registered: 2009-08-24
Posts: 500+

Re: Help with colliding!

How fast your objects are moving will affect most collision detection methods. So will whether the wall is a sprite or part of a background. People often ask about collision detection but the best thing to do is post the most current version of your unfinished game. Then we can pick which one is best suited for your needs.

Here is an idea I had merging a couple of ideas I've read. Lets call your player object Car and the wall, um, Wall, lol. Make two sprites for the Car. Car1 will be the visible sprite that the player sees in the game, Car2 will be the exact same image (and size) as Car1 but is invisible (fully ghosted.) Anytime the player moves, move Car2 first. If Car2 hits nothing, move Car1 to the same position. If Car2 hits the wall, do not move Car1 but instead move Car2 again, back to Car1's position. The point of this is that whatever collision detection method we use, this will keep the player from appearing to go into a wall. But it may not be necessary in the long run, we'll see. Please upload your project and add a link in a new post here. Peace.


aka Pain from DragonSpires, Delrith Online, BotBattle, Urban Dead etc etc lol

Offline

 

Board footer