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

#1 2008-11-29 02:04:40

yoyoma
Scratcher
Registered: 2008-11-28
Posts: 21

need some help with scratch detecting

hi, i have a question about somethgin in scratch. i'm buildign a game where i have to detect where the enemy is without using the point toward tool, so i was wondering, if there is another way that i can detect the enemy so that i can fire accurately at it, and that i can know wehre the enemy is and try to stay away from it, any help is appreciated thank you!

Offline

 

#2 2008-11-29 02:34:10

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: need some help with scratch detecting

You could use the "X of enemy" "Y of Enemy" variables and compare them to your sprites X and Y positions.

Or you could use some form of sensor sprite - eg a ghosted wide sweeping radar line that rotates around your sprite until it finds an enemy.


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

#3 2008-11-29 19:48:34

yoyoma
Scratcher
Registered: 2008-11-28
Posts: 21

Re: need some help with scratch detecting

thanks mayhem greatly appreciate your help! XD

Offline

 

#4 2008-11-29 20:03:43

fullmoon
Retired Community Moderator
Registered: 2007-06-04
Posts: 1000+

Re: need some help with scratch detecting

Mayhem wrote:

Or you could use some form of sensor sprite - eg a ghosted wide sweeping radar line that rotates around your sprite until it finds an enemy.

Wow, that's a great idea! And virtually trig-free!


http://i302.photobucket.com/albums/nn100/fullmoon32/wow.jpg

Offline

 

#5 2008-12-01 22:42:59

yoyoma
Scratcher
Registered: 2008-11-28
Posts: 21

Re: need some help with scratch detecting

hey evyerone i know i asked this question before, but then i read the criteria's wrong..... what  i have to make was to detect where a enemy is without using the point towards tool, and without using the x or y position of the enemy.... i know its a tough one, but then i have 1 sprite in the middle of the map that can help me, and i can also build another sprite that can roam aroudn the map so i was wondering if any of you can help me? i heard that you can use trig. to do it but how?!?!? -_-'

Offline

 

#6 2008-12-01 23:23:23

yoyoma
Scratcher
Registered: 2008-11-28
Posts: 21

Re: need some help with scratch detecting

you can use the code DISTANCE TO but not the x position  or y position or the point toward tool, and there is one extra sprite you can create as liek a sensor but i just dont' get how to make it -_-'

Offline

 

#7 2008-12-01 23:41:07

yoyoma
Scratcher
Registered: 2008-11-28
Posts: 21

Re: need some help with scratch detecting

you can use the code DISTANCE TO but not the x position  or y position or the point toward tool, and there is one extra sprite you can create as liek a sensor but i just dont' get how to make it -_-'

Offline

 

#8 2008-12-02 01:03:48

yoyoma
Scratcher
Registered: 2008-11-28
Posts: 21

Re: need some help with scratch detecting

anyone?
this could be life or death for me.......
lol jk but still.....it would be great....
.........................

Offline

 

#9 2008-12-02 01:51:25

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: need some help with scratch detecting

I alrady posed a link to a demo of using a sensor sprite in the other thread you started asking the same question.


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

Board footer