ScratchData LogoScratchData
Back to Kileymeister_test's profile

PointingTowardsChecker

KIKileymeister_test•Created December 31, 2010
PointingTowardsChecker
2
2
290 views
View on Scratch

Description

This engine allows you to not only check if the sprite is pointing towards a certain sprite, but also if another sprite is pointing at it. This was made for my Tron game so that the AI could tell if you were heading for it or if it was heading for you, but it can also have many uses. Download the project and open sprite "You" to get the engine that checks if you are pointing towards something. Open sprite "Other" to get the engine that checks if another sprite is pointing at it. You can move the sprites around and press space to make the center one point towards your mouse. The small impracticality of this is that it is difficult for a sprite to be exactly facing another without the aid of a point towards block or if they were on a uniform grid and can only point up down left and right. Fortunately in my Tron game they are on a uniform grid. Remember, anyone can use this engine (er, engines)! UPDATES: -Added Gray Area function. This makes the engine a lot more useful. Basically the higher the gray area, the more general you need to be facing a sprite to mark the variables as "True." To make it scrutinous to the rounded pixel, set it to 1.

Project Details

Project ID1510213
CreatedDecember 31, 2010
Last ModifiedDecember 31, 2010
SharedDecember 31, 2010
Visibilityvisible
CommentsAllowed