playMaker

Author Topic: Changing sprite per second and touch detect [SOLVED]  (Read 1443 times)

coxy17

  • Beta Group
  • Sr. Member
  • *
  • Posts: 355
Changing sprite per second and touch detect [SOLVED]
« on: October 19, 2016, 01:34:29 PM »
Hi

I'm after creating a constantly changing image  (sprite) with various images. But only showing 1 per second. Then when the user clicks the screen I need to detect which sprite was visible upon touch.

I know how I can do the touch detect.  I just need help with the best approach to switching the sprite images quickly and stopping upon touch. Any help would be great

Nick
« Last Edit: October 20, 2016, 09:07:52 AM by coxy17 »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Changing sprite per second and touch detect
« Reply #1 on: October 19, 2016, 05:14:20 PM »
Hi,
I would use an array.
Place you sprites in the array and @ runtime get them each sec and store the index nr.
With the index nr you know which image is visible.

coxy17

  • Beta Group
  • Sr. Member
  • *
  • Posts: 355
Re: Changing sprite per second and touch detect
« Reply #2 on: October 20, 2016, 09:07:40 AM »
thanks for this, ive looked into arraymaker and it seems that i can use the hashtables to achieve what im after.