playMaker

Author Topic: Help creating iteration with a button[SOLVED]  (Read 82 times)

Dood

  • Playmaker Newbie
  • *
  • Posts: 2
    • View Profile
Help creating iteration with a button[SOLVED]
« on: June 14, 2019, 03:13:27 PM »
Hello,
How do I make a button in my game that allows the user to perform different actions based on the number of times it was pressed?

Example:
If I press the button once I get an animation of a particular object... If I press the same button again, I get another animation of a different object... And so on...

Is this possible? and how?

Thank you for your time everyone!! 8)
« Last Edit: June 17, 2019, 01:06:31 AM by jeanfabre »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4192
    • View Profile
    • jinxtergames
Re: Help creating iteration with a button
« Reply #1 on: June 14, 2019, 04:47:36 PM »
Hi.
you can have a int variable and on button clicked do 'int add'
Then you can probably use an array to hold the different animations.

Here is a video about arrays :


Dood

  • Playmaker Newbie
  • *
  • Posts: 2
    • View Profile
Re: Help creating iteration with a button
« Reply #2 on: June 15, 2019, 05:58:43 AM »
Allright I will try this out, thanks man, also, I looked at that video prior to coming to the forum, as I knew I would probably need an array. Good job on that video by the way, informative :)

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4192
    • View Profile
    • jinxtergames
Re: Help creating iteration with a button
« Reply #3 on: June 15, 2019, 02:47:03 PM »
Hi.
Its not my video, but you can thumbs up his video :D

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4192
    • View Profile
    • jinxtergames
Re: Help creating iteration with a button[SOLVED]
« Reply #4 on: June 17, 2019, 08:02:25 AM »
Hi.

Here is a sample how to loop (attachment below) .

On the sample i use a int array, but you can use any kind of array.

There are 3 types i used :
Next Array Direct
Int Variable
Iterate

All of them are valid usages, in some cases "int" would be better to use, in other cases "iterate".
Same for Array direct.