Basic math help needed
I want to have an actor that constrains self.alpha to a number based on another actor's self.position.y so that if Y is large, alpha is small and if Y is small, alpha is large. For example, if Y is 900 then alpha is .4; if Y is 450 then alpha is .7; if Y is 0 alpha is 1.
My brain is broken. Please help.
My brain is broken. Please help.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Best Answer
-
mynameisace Hull, UKPosts: 2,484
Just knocked this up for you:
http://mynameisace.com/files/Alpha-Alphalfa.gameproj.zip
I'm no doctor, but I hope this fixes your brain.
Ace
Answers
http://www.mediafire.com/?vprsasx7c9axq3j
self.alpha=(otheractor.position.y-game.maxY)/(game.minY-game.maxY)
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Ace
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User