Game Development Community

Snood type games and Phantasia

by Michael Branin · in Torque Game Builder · 01/22/2007 (7:17 am) · 1 replies

OK I have played Phantasia and its a great game and I have played snood and love it as well. I have a couple of questions regarding those games. in snood you have a turret that basically fires your snood piece in which ever direction you are aiming the turret. this much I have figured out but ... How would the board be set up? I mean do you think they are using a tile map and each piece is in a separate cell of the tile map and if so how does the fired piece actually travel at what ever angle it is fired at.

Question 1

Do you think games link Phantasia and Snood have their play fields set up as tile maps and if so how do you have a piece thats is freely moving across the playfield until it collides with a piece and then snaps into the closest tile map cell. (If they are not using tile maps whats the best way to set something like that up?)

Question 2

When a piece goes up how do you check for other pieces of the same type connected anywhere along the x,y axis

Example:

R = Red
G = Green
B = Blue
Y= Yellow

RRGYB
RGGBY
G


in the above example I fire a green piece up that collides with a green piece and it finds that All 4 green pieces are connected so it would then remove them. this is different from connect 4 in that thaey are not in a row but are all still touching one another.

#1
01/22/2007 (5:40 pm)
Michael,

I have been working on that style of game for a little while.
I can tell you in general terms how I set my "board" up.
I set up an array to use for my board.
First I spawn the object(let's call it a Ball) and set it's initial velocity toward the other balls.I also add it to a simset that contains all the active balls on the board.
I then schedule a function that is called checkboard. I iterate through each ball in the simset and use the getatRest(); method to check each ball to see if it has hit another ball or the board and stopped. If it has stopped I then get it's (X,Y) and check that against a template of the board and see which array position it is the closest to. You can then "Snap" it into that position if it's a little off and Add it to the Array. The best thing I learned while doing this is to actually put the ID of the ball into the array. Then when you iterate through the array to check for 3-in-a-row or any other condition you have access to all of each objects properties and variables, not just a simple "Color Array".
You can probably find another post somewhere about how to actually find your "CLUMP" of one color. The best thing to do is get your objects moving and be able to get them into your array and then try and start messing with formulas and math for Row, Column, Diagonal, clump checking...
Holler back if I missed anything or could help more. I am sort of hung with my game because of the physics issues. Sort of just waiting and hoping for the next release... I'm sure GG are working hard to fix the issues....