TOUR
PRICING
HELP
Stencylpedia
Blocks Guide
Sample Games
Developer Center
FORUMS
CHAT
#MADEINSTENCYL
EDUCATION
SIGN IN
×
Welcome back!
Username or E-mail
Password
(
Forgot?
)
C
OMMUNITY
Home
Issue Tracker
Inbox [0]
New Posts
New Replies
Search
Stencyl Community
→
Stencyl
→
Ask a Question
→
If x of actor is increasing
Pages:
1
If x of actor is increasing
00george
Posts: 161
March 19, 2012, 12:35:43 pm
Hi I have a game attribute called distance to moon and I want to make it so as the y of the actor increases the distance decreases and as the y of the actor decreases I want the distance to increase. How can I do this?
Sunflower
Posts: 591
March 19, 2012, 12:46:18 pm
Code:
[Select]
always / when updating
set Distance To Moon to [[CONSTANT] - [y of Self]]
where CONSTANT is the supposed position of moon. So if e.g. character lands on the moon at y equal to 1000, then you should replace CONSTANT with 1000.
00george
Posts: 161
March 19, 2012, 12:49:39 pm
Thanks for the reply just before this I figured it out for my self but thanks anyway.
Pages:
1