playMaker

Author Topic: How Can I make this happen??  (Read 2594 times)

Cratz

  • Playmaker Newbie
  • *
  • Posts: 21
How Can I make this happen??
« on: August 12, 2016, 07:35:40 AM »
Guys I've been trying to figure this out for so long. If anyone has any clue of how I can accomplish this please let me know how. If you need further details please let me know. Thank you

Mutajon

  • Playmaker Newbie
  • *
  • Posts: 25
Re: How Can I make this happen??
« Reply #1 on: August 12, 2016, 08:36:11 AM »
Create an int variable to mark the next free position (lets say you call it freePos). Set its starting value at 1 (1st position).
Whenever you click a button check freePos to see where to position the next object, then increase freePos by 1...

Cratz

  • Playmaker Newbie
  • *
  • Posts: 21
Re: How Can I make this happen??
« Reply #2 on: August 12, 2016, 09:14:15 AM »
Hi Can I get more detail please? How will it know if the "First position is occupied, or second position and so on?

terri

  • Sr. Member
  • ****
  • Posts: 380
    • terrivellmann.tumblr.com
Re: How Can I make this happen??
« Reply #3 on: August 12, 2016, 09:23:58 AM »
I'd use an Array. If its empty that means position 1 is free, and you add to it.
Next time you'll count it and get 1, so you add the next one to that index.

If you're super new and that sounds confusing, go through the Arraymaker tutorials before doing anything.

However, Mutajon's suggestion is simpler and would also work, but you wouldn't be able to go back and get those values by their corresponding slots later on
« Last Edit: August 12, 2016, 09:25:39 AM by terri »

Cratz

  • Playmaker Newbie
  • *
  • Posts: 21
Re: How Can I make this happen??
« Reply #4 on: August 12, 2016, 08:55:41 PM »
How would you use arraymaker to accomplish this?

Zeldag

  • Full Member
  • ***
  • Posts: 198
Re: How Can I make this happen??
« Reply #5 on: August 13, 2016, 08:18:39 AM »
How would you use arraymaker to accomplish this?

Hi,

It should be fairly simple once you get fammiliar with arrays. I think Terri mostly gave a good overview of how to select the objects:

use an Array. If its empty that means position 1 is free, and you add to it.
Next time you'll count it and get 1, so you add the next one to that index.

If you're super new and that sounds confusing, go through the Arraymaker tutorials before doing anything.

So basically just make an array and add the objects when you press the corresponding button. Then where you display the objects, make it get them from the array in order and display them where you need the objects displayed. So index 0 is displayed in position 1 and so on.

But first go through the tutorials so that you know how arrays work: https://www.youtube.com/playlist?list=PL1EwQda_5HM_n8MEaBGfcXLNpmL8qBqV1

Good luck with it!
« Last Edit: August 13, 2016, 10:52:42 AM by Zeldag »

Cratz

  • Playmaker Newbie
  • *
  • Posts: 21
Re: How Can I make this happen??
« Reply #6 on: August 15, 2016, 05:33:43 PM »
Nice! I will learn as much as I can. Thank you!