playMaker

Author Topic: HashTable, ArrayList, Candy Crush and Tetris.  (Read 5076 times)

TIGGYsmalls

  • Junior Playmaker
  • **
  • Posts: 80
HashTable, ArrayList, Candy Crush and Tetris.
« on: December 18, 2013, 06:34:53 AM »
I want to make a game like a Candy Crush or Tetris. I have looked at the help files and thought the 3 In a Row Game using HashTables would be a good start.

But is it? Or do I use a mixture of both? Because to me it seems like you could do it with both.

Array List..
1.Array List is a List
2.In this we can only add items to the list
3.Here we Can Add any datatype value,Every item in
arraylist is treated as object

Hash Table..
1.Hash Table is a map
2.Here we can add data with the key
3.Retrieving by key in Hashtable is faster than retrieving in
Arraylist

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: HashTable, ArrayList, Candy Crush and Tetris.
« Reply #1 on: December 20, 2013, 01:15:00 PM »
Hi,

Yeah,

 I would for example have an array per row and when a piece finally stops, I would register the new blocks in the appropriate rows and then run a check on each rows starting from the bottom.

 I don't think you need hashtables here , only arrayLists.

Bye,

 Jean


bye,

 Jean

TIGGYsmalls

  • Junior Playmaker
  • **
  • Posts: 80
Re: HashTable, ArrayList, Candy Crush and Tetris.
« Reply #2 on: December 26, 2013, 09:48:04 AM »
There's no inherent link between a world object and the object stored in the Array/Hash is there?

If you create or destroy an object form a Array/Hash you always have create or destroy its real world counterpart separately?

I hope I have been clear with this question.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: HashTable, ArrayList, Candy Crush and Tetris.
« Reply #3 on: December 27, 2013, 02:29:33 AM »
Hi,

 GameObjects are only "references", so if you delete it somewhere, somehow, ALL references will be then void,

 BUT, in arrays or hashtables, the entry will be just void, not removed, so you will have:

GameObject 1
void
GameObject 2

also, removing an entry in an array or hashtable doesn't delete the reference ( when it's a gameobject, a texture, a material or any object or variables), ints, string, floats, etc are lost of course).

Does that make sense?

bye,

 Jean

TIGGYsmalls

  • Junior Playmaker
  • **
  • Posts: 80
Re: HashTable, ArrayList, Candy Crush and Tetris.
« Reply #4 on: January 07, 2014, 12:27:51 PM »
Are there any variables held on an object in an Array list?

If I use Array List Get, then store that object, then use Get FSM String on that object, I don't get the correct answer.

I should probably store the reference in a string and not the object, right?

TIGGYsmalls

  • Junior Playmaker
  • **
  • Posts: 80
Re: HashTable, ArrayList, Candy Crush and Tetris.
« Reply #5 on: January 08, 2014, 10:14:54 AM »
When an object says None, is it not the same as null?

This should be in state 4 not 5?

I am getting the object from a Hash Table if that makes a difference?
« Last Edit: January 08, 2014, 10:36:47 AM by TIGGYsmalls »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: HashTable, ArrayList, Candy Crush and Tetris.
« Reply #6 on: January 10, 2014, 06:45:24 AM »
Hi,

 It should be, I am currently looking at this issue with the "gameObjectisNull" action.

bye,

 Jean

TIGGYsmalls

  • Junior Playmaker
  • **
  • Posts: 80
Re: HashTable, ArrayList, Candy Crush and Tetris.
« Reply #7 on: January 14, 2014, 12:30:14 PM »
Well, this is the game so far if anyone wants it.

Just has one bug which you will find when you play (and if I set up the package properly). If anyone can fix it that would be most helpful.

Any comments on the FSMs would be good too. I had to break it into segments because it was getting too complicated. It seems to be a little clumsy now its done though.
« Last Edit: January 14, 2014, 12:51:44 PM by TIGGYsmalls »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: HashTable, ArrayList, Candy Crush and Tetris.
« Reply #8 on: February 03, 2014, 03:52:32 AM »
Hi,

 your package has missing actions. Can you repack?

 Make use of my tool if you want, it will allow you to package safer.

http://hutonggames.com/playmakerforum/index.php?topic=5387.msg25829#msg25829


bye,

 Jean