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

#26 2010-08-12 20:36:32

murpho
Scratcher
Registered: 2010-07-01
Posts: 1000+

Re: Better collision script

ok thatnjs but i am starting to work with unity3d at: www.unity3d.com


https://lh6.googleusercontent.com/-l-rgCPiQ9pY/Tp32n1MRUEI/AAAAAAAADoA/HNQWbO8OOaA/s510/soccerleague.gif

Offline

 

#27 2010-08-12 20:51:07

MabonBaladevaKain
Scratcher
Registered: 2010-07-25
Posts: 80

Re: Better collision script

This one is BETTER in some ways. Try it!
Hopefully if the other one didn't help, then this one will!

http://scratch.mit.edu/projects/MabonBaladevaKain/1243174

Offline

 

#28 2010-08-12 21:10:36

MabonBaladevaKain
Scratcher
Registered: 2010-07-25
Posts: 80

Re: Better collision script

Hmm ... Unity3d looks kewl but what is it exactly?
Is it fully contained with everything needed right there or is it one of those kits where you need to find other apps to do some of the heavy lifting like 3d models and such. Guess what I'm asking is ... Do I need something like Blender to use with it?

It says I can get a free version, but is that only a trial? .. will it expire?
I'm gonna probe their site a bit more. Thanks for the Link!

Offline

 

#29 2010-08-12 22:20:06

Ratty1967UK
Scratcher
Registered: 2007-05-16
Posts: 88

Re: Better collision script

Oh dear... so much effort for so little gain... one thing you learn very quickly with any programming tool is to adapt your algorithms to work within the limitations of the language, don't fight against them!

A little lateral thinking is often all you need!  smile

Offline

 

#30 2010-08-12 22:32:09

MabonBaladevaKain
Scratcher
Registered: 2010-07-25
Posts: 80

Re: Better collision script

Ratty1967UK wrote:

Oh dear... so much effort for so little gain... one thing you learn very quickly with any programming tool is to adapt your algorithms to work within the limitations of the language, don't fight against them!

A little lateral thinking is often all you need!  smile

What's that supposed to mean?

Offline

 

#31 2010-08-12 23:39:23

murpho
Scratcher
Registered: 2010-07-01
Posts: 1000+

Re: Better collision script

MabonBaladevaKain wrote:

Hmm ... Unity3d looks kewl but what is it exactly?
Is it fully contained with everything needed right there or is it one of those kits where you need to find other apps to do some of the heavy lifting like 3d models and such. Guess what I'm asking is ... Do I need something like Blender to use with it?

It says I can get a free version, but is that only a trial? .. will it expire?
I'm gonna probe their site a bit more. Thanks for the Link!

its simple and easy to use with some pebuilt 3d material


https://lh6.googleusercontent.com/-l-rgCPiQ9pY/Tp32n1MRUEI/AAAAAAAADoA/HNQWbO8OOaA/s510/soccerleague.gif

Offline

 

#32 2010-08-13 00:32:09

MabonBaladevaKain
Scratcher
Registered: 2010-07-25
Posts: 80

Re: Better collision script

pre-built? .. but you can still make your own stuff though right?
If everything is pre-built it'd sorta defeat the purpose for me.
If I want to make my own stuff for it do I need to use a different 3d program to make the models? or is it all self-contained so that I can use one program to do everything?

Offline

 

#33 2010-08-13 05:07:53

ando520
Scratcher
Registered: 2010-08-13
Posts: 1

Re: Better collision script

no it would cause the character to freeze and not be able to move at all

Offline

 

#34 2010-08-13 10:42:17

murpho
Scratcher
Registered: 2010-07-01
Posts: 1000+

Re: Better collision script

MabonBaladevaKain wrote:

pre-built? .. but you can still make your own stuff though right?
If everything is pre-built it'd sorta defeat the purpose for me.
If I want to make my own stuff for it do I need to use a different 3d program to make the models? or is it all self-contained so that I can use one program to do everything?

as far as i know you need a seperate system. its not ment for you to make your own models


https://lh6.googleusercontent.com/-l-rgCPiQ9pY/Tp32n1MRUEI/AAAAAAAADoA/HNQWbO8OOaA/s510/soccerleague.gif

Offline

 

#35 2010-08-15 10:15:05

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

Re: Better collision script

Most old-school rpg games use a tile-based movement system in which collisions are handled through data means rather than the graphic-based methods that you commonly find in Scratch projects. For an example of what this is, please check out my post about Pacman (it uses a tile system) here.

Or, here is a (hopefully) simplified answer. A tile system basically divides the screen into squares. So any square either blocks or allows sprite movement through it. As the game runs, sprites move from one tile to another. Collision detection works by checking to see if two sprites are both located in the same tile at the same time.

Lastly, you say you do not want to use color sensing due to the extra work you must do to ensure that sensed colors are not used except where appropriate. I sympathize with your reservation, however, in my opinion the more complicated your project is, the more time you must spend ensuring that everything works together anyway, and the more likely that you will need to use multiple collision-detection methods instead of relying on one method to work for all parts of your game.

Last edited by Locomule (2010-08-15 10:20:39)


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

Offline

 

#36 2010-08-31 16:28:05

Ratty1967UK
Scratcher
Registered: 2007-05-16
Posts: 88

Re: Better collision script

MabonBaladevaKain wrote:

Ratty1967UK wrote:

Oh dear... so much effort for so little gain... one thing you learn very quickly with any programming tool is to adapt your algorithms to work within the limitations of the language, don't fight against them!

A little lateral thinking is often all you need!  smile

What's that supposed to mean?

Instead of trying to invent your own collision detection systems, use the one scratch provides and work within it's limitations  smile

Offline

 

#37 2010-08-31 20:10:08

laser100
Scratcher
Registered: 2009-12-04
Posts: 100+

Re: Better collision script

Ratty1967UK wrote:

MabonBaladevaKain wrote:

Ratty1967UK wrote:

Oh dear... so much effort for so little gain... one thing you learn very quickly with any programming tool is to adapt your algorithms to work within the limitations of the language, don't fight against them!

A little lateral thinking is often all you need!  smile

What's that supposed to mean?

Instead of trying to invent your own collision detection systems, use the one scratch provides and work within it's limitations  smile

Scratch doesn't have a built in collision script.

Offline

 

#38 2010-09-01 13:11:39

rdococ
Scratcher
Registered: 2009-10-11
Posts: 1000+

Re: Better collision script

The code is here:

Walls:

Code:

[forever]
[if touching character]
{set variable to (1)}
[else]
{set variable to (0)}
[/if-else]
[/forever]

Character, use the point direction block in the apporpite (e.g, move right, direction should be 90. move left, direction should be -90 or 270. move up, direction should be 0. move down, direction should be 180) direction:

Code:

[forever]
[if variable = 1]
move () * -1 steps
[/if]
[/forever]

1 shared variable needed.

Offline

 

Board footer