Hi I am trying to make like a whack-a-mole game in my game. The player is trying to catch a crab. I really want it to appear random to but haven’t gotten so far jet.
This is my problem, after the player catch the crab it is still visible on the screen?
This is my code:
Code: ags
It must be because the game check the visible in the game repeat but I must have there or?
I use 9verb and AGS 3.2
this is the code on the crab:
Code: ags
This is my problem, after the player catch the crab it is still visible on the screen?
This is my code:
function room_RepExec()
{
if (clock>0) {
clock++;
}
if (clock==20){
oCrab3.Transparency=0;
object[2].Move(360, 230, 10, eNoBlock, eAnywhere);
object[0].Move(324, 300, 10, eNoBlock, eAnywhere);
//character[2].y = 287;
}
else if (clock==400) {
oCrab3.Transparency=100;
object[2].Move(140, 230, 10, eNoBlock, eAnywhere);
oCrab2.Transparency=0;
object[1].Move(448, 287, 10, eNoBlock, eAnywhere);
//character[3].x = 448;
//character[3].y = 287;
}
else if (clock==600) {
oCrab2.Transparency=100;
object[1].Move(500, 300, 10, eNoBlock, eAnywhere);
oCrab1.Transparency=0;
object[0].Move(224, 128, 10, eNoBlock, eAnywhere);
//character[2].x = 224;
//character[2].y = 128;
}
else if (clock==800){
oCrab1.Transparency=100;
oCrab2.Transparency=100;
oCrab3.Transparency=100;
clock=1;
}
}
It must be because the game check the visible in the game repeat but I must have there or?
I use 9verb and AGS 3.2
this is the code on the crab:
function oCrab1_AnyClick()
{
// LOOK AT
if(UsedAction(eGA_LookAt)) {
player.Say("Its a crab with catching claws");
}
// OPEN
else if (UsedAction(eGA_Open)) {
Unhandled();
}
// CLOSE
else if (UsedAction(eGA_Close)) {
Unhandled();
}
// USE
else if(UsedAction(eGA_Use)) {
Unhandled();
}
// Push
else if(UsedAction(eGA_Push)) {
Unhandled();
}
// Pull
else if(UsedAction(eGA_Pull)) {
Unhandled();
}
// PICKUP
else if(UsedAction(eGA_PickUp)) {
player.Say("Finelly");
oCrab1.Visible=false;
cEgo.AddInventory(iCrab);
}
//USE INV
else if(UsedAction(eGA_UseInv)) {
Unhandled();
}
// don't forget this
else Unhandled();
}