How to change the width ONLY 1 SIDE?
How do you change the width on only 1 side.
https://www.dropbox.com/s/lxhzmok5all526u/Example.gameproj.zip
Notice how it's increasing in size on BOTH going up AND down. How to make it only increase going one way?
I think its and easy question.
Can anyone help?
Thanks
https://www.dropbox.com/s/lxhzmok5all526u/Example.gameproj.zip
https://www.dropbox.com/s/lxhzmok5all526u/Example.gameproj.zip
Notice how it's increasing in size on BOTH going up AND down. How to make it only increase going one way?
I think its and easy question.
Can anyone help?
Thanks
https://www.dropbox.com/s/lxhzmok5all526u/Example.gameproj.zip
Best Answers
-
gyroscope I am here.Posts: 6,598
Hi @Chakku@MSEagle2 But how to specify whether to grow on the left or right (in my case up or down).
If growing to the left or right, this will alter the x coordinate; in your case, up or down , will effect the y coordinate. These need to be half the growth rate of the changing side, exactly as @MSEagle2 mentioned.
So based on Rule you have, add a change y position too (exactly half the growth rate):
Timer Every 0.04 seconds
Change Attribute self.Size.Height to self.Size.Height+2
Change Attribute self.Position.Y to self.Position.Y+1""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
-
CodeMonkey Posts: 1,803
An actor's position is always in the center of that actor. If the width changes, you'll see that it increases in 2 directions.
What you would need to do is store its current position and the width before changing the width of the actor, then as you increase the width, you would either need to add or subtract half of the change in width for it to appear to increase in one direction or the other.
Answers
Please download the example file I uploaded to see what I mean
Thanks for the response.
Thanks it worked!