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

#1 2008-12-05 23:59:11

scratchrulesOMG
Scratcher
Registered: 2008-12-03
Posts: 14

almost figure it out just a little more help.....

hi, i almsot figured it out, but i just have one more small quesiton, i used the cosine law to determine where the enemy is and to follow the enemy, so far the code work but one small problem is that there are more than one same angle throughout the map and that the sprite dosn't know which way(up,down,left,right) the enemy is, so i was wondering if any of you out there can help me fiure this out thank you very much you have all been great help to me!

Offline

 

#2 2008-12-06 04:04:04

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

Re: almost figure it out just a little more help.....

You need an "if .... else statement to check whether or not the target is to the left or right of your main sprite.  Then in one you have you normal formula, in the other yu have you normal formula * -1


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