Help with Instance variables and on-touch

Get help using Construct 2

Post » Sun Apr 07, 2013 9:22 am

[QUOTE=E2GameStudios] Very cool...I had to make one slight adjustment to the global variable (from 3 to 4) as when it was set to 3 it wouldn't actually play animation3 prior to halting the forward animations. If I am understanding this correctly...if I were to add animations to the sprite object I would simply increase the global variable a corresponding number of times.

Does that sound about right?[/QUOTE]

That is correct. Sent you pm by the way :)
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Sun Apr 07, 2013 11:08 am

It seems I lack the Rep to respond to your PM. :( However, you mentioned that you located me via external means. Reach out to me using that method and we can discuss options for when you have more time on your hands. Also if you do a facebook search for "E2 Game Studios" you can see more about our current project. I do environmental Art, GUI, models and textures etc. Not much on character art though. I have to contract that out along with Music.
B
11
S
2
Posts: 65
Reputation: 1,396

Post » Sun Apr 07, 2013 11:42 am

Ok since we are tearing though my programming tasks the next thing I am trying to do is to establish a method that would allow a 4th sprite object to launch a related layout depending upon which animation the original LevSel sprite object is currently on. In our example file imagine I had a a button at the bottom of the layout and that if a user is currently on "animation2" of the levSel sprite when they click on that button then a layout dedicated to "animation2" is launched. Likewise...if "Animation1" or "Animation3" has just played and they click the button they would be directed to a layout for "animation1" or "animation3" (respectively).

It would seem to me that since we have successfully tied the number of touches to the "Level" global variable then we could use the current number of touches (the result of whatever positive or negative numbers are generated through Forward or Reverse clicks) to a given sum and use that number as a method for defining which layout to load.

For example: If the player clicks forward button twice and the reverse once they would find themselves at the start frame of "animation2"...or from a value standpoint that would be +1 +1 -1 in the touches variable which would result in a +1 total number of touches (1+1-1=1). Maybe I am thinking about this all wrong but it seems that would allow me to essentially assign each animation a static touches value and that I could use that to direct a player to a specific layout. Am I heading in the right direction with this?
B
11
S
2
Posts: 65
Reputation: 1,396

Post » Sun Apr 07, 2013 3:51 pm

[QUOTE=E2GameStudios]

It would seem to me that since we have successfully tied the number of touches to the "Level" global variable then we could use the current number of touches (the result of whatever positive or negative numbers are generated through Forward or Reverse clicks) to a given sum and use that number as a method for defining which layout to load.

For example: If the player clicks forward button twice and the reverse once they would find themselves at the start frame of "animation2"...or from a value standpoint that would be +1 +1 -1 in the touches variable which would result in a +1 total number of touches (1+1-1=1). Maybe I am thinking about this all wrong but it seems that would allow me to essentially assign each animation a static touches value and that I could use that to direct a player to a specific layout. Am I heading in the right direction with this?[/QUOTE]

That would be correct way to think it, the touches variable represents the selected animation, which represents certain level. So you could add 'launch' button, or perhaps click on sprite event, that would start a certain layout depending on the touches variable.
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Sun Apr 07, 2013 8:57 pm

lol...now only if I can figure out how to do that!
B
11
S
2
Posts: 65
Reputation: 1,396

Previous

Return to How do I....?

Who is online

Users browsing this forum: MarkThomas, Yahoo [Bot] and 0 guests