when key pressed player move but return to inital position?
neo_matrix31@hotmail.com
Member Posts: 32
hi all,
i need script for when key pressed player move but return to inital position?
thanks
i need script for when key pressed player move but return to inital position?
thanks
Comments
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
player is at point 1
when we pressed key and realese it , he move to point 2 and return to point 1
no i dont want him pause new position
i want him return immetiatly to initial position
Hi @neo_matrix31@hotmail.com
Try this: two integer attributes, call one PosX and put your actor's starting X position as its value, and PosY, similar but with initial Y position. Also make a boolean called Go.
Rule: When key S is pressed and Go is false--- or whatever other key you want
Change attribute Go to true
Rule: When key S is released and attribute Go is true
Interpolate self.Position.X to ?? Duration: 2 seconds --- 2 secs as an example
Interpolate self.Position.Y to ?? Duration: 2 seconds
Timer: After 2 seconds
Interpolate self.Position.X to PosX Duration: 2 seconds
Interpolate self.Position.Y to PosY Duration: 2 seconds
Timer: After 4 seconds
Change attribute Go to false
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
can you make simple example
thanks
OK, I will, hopefully a small test will help you to learn. Just give me five mins...
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Rule: When key S is pressed and Go is false (how to make 2 rules conditions ? i use group ) --- or whatever other key you want
Change attribute Go to true
I've made an example for you but it's for a Mac...don't know if it'll help you... (guys, can Windows users open mac gameSalad files? I should know that , but don't!)
Anyhow, here it is, hope it helps:
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
and i think this what you try to learn me !!!!
I LIKE YOU MANNNNN
you give me way ... and logic
the solution was
rule ... when touch is pressed ... interpole attribute player to his position y
make timer for 2 seconds and interpolate attribute to his position y
i really really really thanks you for your help
you make me understand logic of gamesalad
now
i try some thing with interpolate and selfposition but always bug
i show you picture of what iam need
thanks
http://www.hostingpics.net/viewer.php?id=742201Nouvelleimagebitmap.jpg
WHAT DO YOU THINK?, WHAT I HAVE TO DO ?
Hi, please find attached a test game file for what you're after. Hopefully this Mac version can be read via the Windows GSC so you can learn what's going on (which is very straightforward).
Btw, have you gone through the Manual? If not, you'll find it very helpful, especially if you're new to GameSalad. You can download a copy by pressing Help tab found at the top of this web page.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
but not work because i have windows version
OK, I've found out that most Mac GSC files should now run on a Windows machine running GSC. So download the above file and decompress it.
Now is it showing as a folder on your machine? If so, open the folder and double-click the .gsproj file...fingers crossed it'll open.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
when i open your file
i have no actor no behaibviors nothing
and when i play the scene
i only see the red touch here button
and when i click on it nohting happen
i dont know how to thank you
about touch button ... thing 1 and thing 2
thanks
OK, before anything else, check to see that you've got the game file set up as iPad Landscape in Project Info. (The screen size might not have picked up properly from Mac into Windows for some reason and is too small, so hiding the other two actors...)
If that doesn't solve it, then I'll type out the programming here as you suggested.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
i see it in red ... or maybe i have dalton
I've no idea what "dalton" is... :-? But hey, doesn't matter what colour it is!
So did you try changing the screen size as I suggested? Either way, here are the straightforward rules (in Mac format, I'm sure you can amend for Windows terminology):
Note that the following y coordinates are based on the "Thing" actors being 100 x 384 each, and on an iPad landscape scene. Obviously change accordingly to your spec.
-- make a boolean called Go
--"Touch here" button:--
Display Text Touch here
Rule: When touch is pressed
Change Attribute Go to true
Rule: When touch is released
Change Attribute Go to false
---Thing 1 actor---
Display Text Thing 1
Rule: When scene.Go is true
Interpolate self.Position.Y to 576
Otherwise
Interpolate self.Position.Y to 730
---Thing 2 actor---
Display Text Thing 1
Rule: When scene.Go is true
Interpolate self.Position.Y to 192
Otherwise
Interpolate self.Position.Y to 38
OK, hope we're there now.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
but about returning initial position !?
look good to your behaviors !!!