help with dr mario style game

Hi,

 

I’m trying to make a game like this… 

 

https://www.youtube.com/watch?v=xT4ksAgQouc

 

but i don’t know where to start with…

 

I made the grid and spawn all the virus ( as display.newRect )

 

after that i made the control system for the new spawned pill.

 

Then, I set the a timer to transit down the pill. When the raycast detect the virus, it pause the timer.

 

and i don’t know how to detect the virus and pill.

 

I have a virusTable and pillTable for them when it spawns

 

[lua]newPill = display.newRect ( group, 0, 0, gameSize, gameSize )

newPill:setFillColor( 0.8, 0.1, 0.1 ); newPill.pillType = “red”

pillTable[newPill] = newPill

newVirus = display.newRect ( group, virusX, virusY, gameSize, gameSize )

newVirus:setFillColor( 0.8, 0.1, 0.1 ); newVirus.virusType = “red”

virusTable[newVirus] = newVirus[/lua]

in raycast: should i use something like this??

( i have the new spawned pill in the control group, and when the new pill spawn it will remove it from the group and the new one will replace it)

[lua] down = gameSize + 1

local testForDownHit = physics.rayCast (control_Group[a].x, control_Group[a].y, control_Group[a].x, control_Group[a].y + down, “sorted”) or {}

for p = 1, #testForDownHit do
    if ( testForDownHit[p].object.pillType == v.virusType ) then

          print (“hit”)

    end
end[/lua]

 

can you give me some advice on 

 

  1. detecting all those virus and test for match.

     - should i use 2 tables for both virus and pill?

 

  1. how to separate the pill to half, when the match done

 

  1. should i use collision on this game or raycast 

 

I built a Dr. Mario-ish game in Corona a while back…

http://fraudtycoon.com/

It’s not quite the same game play as Dr. Mario, but I used two separate graphics for the cards and moved them together stopping them when they hit. I then counted all the colors making matches, counted again looking for “orphaned” cards and transitioned them to the lowest available open area, then did the whole thing again until we had no new matches.

I built a Dr. Mario-ish game in Corona a while back…

http://fraudtycoon.com/

It’s not quite the same game play as Dr. Mario, but I used two separate graphics for the cards and moved them together stopping them when they hit. I then counted all the colors making matches, counted again looking for “orphaned” cards and transitioned them to the lowest available open area, then did the whole thing again until we had no new matches.