i need help moving
GM_Pandagames
Member Posts: 228
how do you make so if you tap to the right of an actor it moves right? do you put 2 blocks and put if touch is inside the right one move right?
Comments
I'm just typing that off the top of my head, without testing it, but it should work.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
when mouse position x is less than 160 and pressed change game.left to true
This should work
Need Help? Email Me | Templates | Full Game Source Code
or do you have 1 actor and when you touch outside of the actor on the right side it moves to the right?
can you try to explain better ?
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
Hi @GM_Pandagames Similar to what the other guys said, but with a bit more detail (although still a rough idea):
Make a real attribute, called PosX.
Bring an actor onto your screen, make it the size of the screen, call it Back.
Put the actor you want to move onto the screen. Change the value of PosX to its X position. In the Rules of the moving actor, put:
Constrain Attribute self.Position.X to PosX
Now in the Rules of the Back actor, put:
Rule: When touch is pressed
Rule: ---nested in above--When game.Touches.Touch 1.X > scene.PosX
---your moving rules to the right for your moving actor, depending on the method of moving chosen
Otherwise
---your moving rules to the left for your moving actor, depending on the method of moving chosen
THat should give you a good start.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
I changed it up from my description above so there are no constraints.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page