this could be useful for a zombie game. zombie points towards nearest sprite in human list, human points towards (and turns 180 degrees) nearest zombie on list
Basically, each sprite has a specific number. It feeds its x and y positions into a common list at its specified number, then reads into that list to find the closest x/y coordinates, which tells the sprite which number arrow is closest. Meanwhile, a "pointer" sprite hops from sprite to sprite based on the numbers given to each sprite. Each sprite waits until the pointer sprite hits the closest sprite to it and points towards it. Simple as that! :P
hey fullmoon, you know, you didn't need to put (abs of (sqrt of (then pythagoreum's theorum))) you know. You don't need the abs block, because even if a number in the equation is negative, it will square itself and then eventually become positive. Just wanted to tell you. Cool project, btw.
Download the 16 sprites and 32 scripts of "Arrows" and open it in Scratch
Project Notes
Using the list function in 1.3, complex object interaction like this is now implementable. Each arrow finds the closest one to it and points towards it. It requires an "angle pointer" sprite to function. I tried it using trigonometry, but there was only a minimal performance gain and multiple sprites caused error messages. Oh, well!
Comments
You need to be logged in to post comments
Add a Comment
this could be useful for a zombie game. zombie points towards nearest sprite in human list, human points towards (and turns 180 degrees) nearest zombie on list
Yeah, most definitely. I've always wanted to do a zombie game in the style of Colkadome's Krazy Killer projects ((link to project)">(link to project)
(view all replies)Yo dude.
This in incredible! I looked at the code but my lack of l337 sk1llz hinders me, can you explain it?
Basically, each sprite has a specific number. It feeds its x and y positions into a common list at its specified number, then reads into that list to find the closest x/y coordinates, which tells the sprite which number arrow is closest. Meanwhile, a "pointer" sprite hops from sprite to sprite based on the numbers given to each sprite. Each sprite waits until the pointer sprite hits the closest sprite to it and points towards it. Simple as that! :P
This has distinct possibilites! Very good!
Cool, it works now! Really slow though.
interesting
textbox? lol typo!
**textbook. :P
hey fullmoon, you know, you didn't need to put (abs of (sqrt of (then pythagoreum's theorum))) you know. You don't need the abs block, because even if a number in the equation is negative, it will square itself and then eventually become positive. Just wanted to tell you. Cool project, btw.
lol thanks, I think you're right. I was paging through my new math textbox and thinking about that!
Cool, this is in Top Viewed!
Interesting! And now i must learn the "lists" of Scratch. Thanks.
Cool
Not bad, what do you think of Scratch 1.3?
Oh, and a show/hide listwatcher block would be nice, but overall, it's impressive.
It's great! I've had a lot of time to play with the beta, and my only quips are that there is not built-in sort/reverse block like in Jens'.
Nice! (doesn't seem to work online yet, but I'm sure this will be resolved shortly)
Yeah, all 1.3 projects don't function at all online yet.
neat
i.ve got a scratch 1.3 project
Does this work for you online?
(view all replies)