Change image after an actor move direction on grid
wolala123
Member Posts: 249
i have little bit problem ...i have an actor on grid can swipe up and etc..for example, now i swipe up and the previous grid will change to other image..how do it?
Comments
Hello @wolala123
99.9% of people starting threads on these GameSalad Forums want help to solve a problem… so to make your heading "Help me to solve problem" is not only pointless but doesn't give an idea to anyone what your problem is… please make your thread headings more descriptive in future.
OK, back to your question, it's perhaps a little difficult to give a precise answer without more details, but with the info you've given, roughly the following possibly will work with your setup:
Make a real attribute, let's call it PosY, then a Constrain Attribute behaviour on the actor that's being swiped y position:
Constrain Attribute PosY to self.Position.Y
Then a Rule along the lines of:
When PosY =< ??
Change Image NewPic
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Hi again, I started answering this for you and realised it's more complex than I thought… by the sound of it'd benefit by using a table, I'm certain.
And although you've given more info, there's still a few variables which I'm unsure about… to have this prob. solved for you I'd need to see the game file really…and I guess anyone else would too…
So if you're willing to show that, I'll have another go…(unless another member can solve this without that… ;-) )
OK, a rough explanation as to what's needed (not mentioning aspects of using a table though…)….enough to say you need attributes for where the dragged actor has come from, as well as where it lands up. This then becomes where it's dragged from when it's dragged again, etc.
in the actor's touch released rule, you need to make a boolean trigger to true when the actor is successfully into the next square. And in each of the square's rules, when boolean trigger is true, when square number equals dragged from number, change image.
I hope that's some help towards what you want to achieve… it's not really one of these problems where the solution can be written down simply unfortunately...
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Hi @wolala123 the same as I wrote in reply to your DM, I'll see if I can find some time to look at your project this evening. (I've been up to my ears in it trying to finish my latest project) :-)
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
OK, @wolala123 "only" two weeks or more later than I said, apologies…. Your polite insistence via your DMs paid off… :-) I found some time tonight to work on your game file, so finally here's my solution for what you want, based on the more info (the finished game example) you gave me… I understand completely what you want to achieve now.
A couple of things to mention: firstly there's a lot of redundant stuff from your original programming that I didn't clear, so just be aware of that; and to mention that for each of your levels, you can make a different 5x5 table, showing either 1's or 0's as you want for each, as I've done in the first example one.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
*bump* for @wolala123 mainly...
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
OK, @wolala123 Here's the updated file with the black squares deleted as the main player moves on, as you requested in another DM… there's more than one solution to this, I chose to spawn the white square to act as a blanker. I've also tidied up a bit and mainly revised the programming in the up, down, left and right rules in the red ball.
Still lots to do for your other levels, and many refinements I should think, but I'm certain my game file will be a great platform for you to build on. Best of luck with it, and don't forget to post in your thread here when you finally get your game published! :-)
P.S I coloured the white square for testing purposes and for some peculiar reason - even though I'd unlocked all those on-screen as instances, it still coloured them… a bug, I'm thinking… anyhow, enough to say, I forgot to take the colour off and return it to white, but that'll be no problem for you to change back of course.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
*bump* again for @wolala123 mainly…
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
@wolala123 Glad to hear; and you're welcome. :-)
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps