B
Blakkid489
Guest
GMS2
For those of you unaware of the game itself....
So far this is my code to attempt this...
and here's the result
Quesion 1: Is there a way I can manipulate this code to work when there is a cluster of them instead of just a horizontal and/or vertical collision?
Question 2: How to make some fall when not connected to anything?
Question 3: How do I get the gems to align to the grid as they do in bust a move?
For those of you unaware of the game itself....
So far this is my code to attempt this...
Code:
#region My Code
iAngle += 10;
if (gridSnap)
{
if (!place_snapped(24,24)) && (place_meeting(x,y,oWall))
{
move_snap(24,24);
speed = 0;
iStable = true
alarm[0] = 5;
}
if (!place_snapped(24,24)) && (place_meeting(x,y,oBubbleParent))
{
move_snap(24,24);
speed = 0;
iStable = true;
with (oBubble)
alarm[0] = 5;
}
}
if (place_meeting(x,y,oWall))
{
gridSnap = true;
}
if (place_meeting(x,y,oBubbleParent)) && (!dead)
{
gridSnap = true;
iStable = true
isShooting = true;
}
if x < 24 || x > 192
{
if (!gridSnap)
hspeed = hspeed * -1;
}
if (canGrav)
{
gravity = gravPower;
gravity_direction = 270;
}
#endregion
if (gridSnap) && y > 192
instance_destroy();
Code:
if (gridSnap)
{
if (x < 145) && (y > 47)
if (!position_empty(x+24,y)) && (!position_empty(x+48,y))
{
var n1,n2
n1 = instance_position(x+24,y,oBubble);
n2 = instance_position(x+48,y,oBubble);
if (n1.iStable) && (n2.iStable)
{
if (n1.iColor == iColor) && (n2.iColor == iColor)
{
match = 1;
}
}
}
if (y < 169) && (y > 47)
if (!position_empty(x,y+24)) && (!position_empty(x,y+48))
{
var n3,n4
n3 = instance_position(x,y+24,oBubble);
n4 = instance_position(x,y+48,oBubble);
if (n3.iStable) && (n4.iStable)
{
if (n3.iColor == iColor) && (n4.iColor == iColor)
{
match = 2;
}
}
}
switch (match)
{
case 1:
with (n1)
alarm[1] = 1;
with (n2)
alarm[1] = 1;
alarm[1] = 1;
match = 0;
break;
case 2:
with (n3)
alarm[1] = 1;
with (n4)
alarm[1] = 1;
alarm[1] = 1;
match = 0;
break;
case 3:
with (n5)
alarm[1] = 1;
with (n6)
alarm[1] = 1;
alarm[1] = 1;
match = 0;
break;
}
}
Code:
instance_destroy();
and here's the result
Quesion 1: Is there a way I can manipulate this code to work when there is a cluster of them instead of just a horizontal and/or vertical collision?
Question 2: How to make some fall when not connected to anything?
Question 3: How do I get the gems to align to the grid as they do in bust a move?