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

#1 2008-11-29 23:10:56

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

i have another question...

hi i have another question.... is there a way where i can detect where an enemy is without using the point towards tool and circle around him? any help is greatly appreciated thank you

Offline

 

#2 2008-11-29 23:50:16

Metroidlegend
Scratcher
Registered: 2008-07-12
Posts: 91

Re: i have another question...

x position of enemy and y position of enemy maybe?

Offline

 

#3 2008-11-30 03:01:37

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

Re: i have another question...

is there anyway that you can show me? like a sample script? cu i'm actually really new at this so i dont' really kwno how eveyrthign goes............. thx

Offline

 

#4 2008-11-30 03:55:14

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: i have another question...

In the Sensing section of the blocks pallet, you will see a block that people just call the "sensing block".  It right under the Timer blocks and just has two drop-down menus on it.  The right one lets you look at the properties of any sprite in your project.  The left one controls which property you will get.  You can use this to look up the X and Y locations of your enemy and use them in other blocks.

But if your goal is to circle around an enemy, knowing it's X and Y position isn't going to help all that much...it's still going to take a lot of math (trigonometry) to figure out how to circle it.  You will find it much simpler to have a sprite point towards the enemy, then turn a little less than 90 degrees and walk a bit, and keep repeating that type of motion.  You can Hide the sprite while it's turning then Show it again when it is facing the right direction and it will look pretty good.  Here is a sample

http://scratch.mit.edu/projects/Paddle2SeeFixIt/336913


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#5 2008-11-30 04:04:38

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

Re: i have another question...

thx paddle2see but i'm trying to make one that cannot use the point towards tool so i think the trig way is my only option? and id ont' really get how to use the trig way to do it so iwa s wondering if anyoen can like explain it to me or show me an example, but thank you though greatly appreciated!! ^^

Offline

 

#6 2008-11-30 05:07:24

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

Re: i have another question...

Try this:

http://scratch.mit.edu/projects/Mayhem/336947


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

 

#7 2008-11-30 07:03:20

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

Re: i have another question...

why dont you want to use a point towards? you canhave another sprit point towards it and hide that sprite. that way no one sees it and its nice and simple

Offline

 

#8 2008-11-30 13:09:02

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

Re: i have another question...

thx guys, really aprreciated!! ^^

Offline

 

Board footer