Hello!
In my game I would like some event to happen after the player presses a button, but I don't know exactly how to do this. Here is my code:
on "eye"
{
actor.GoTo(597, 484);
actor.TurnTo("DI_UPRIGHT");
Game.Interactive = false;
actor.Talk("Oh God! I don't wanna do this");
actor.Direction = DI_DOWN;
Sleep(700);
actor.Talk("Give me a sign");
actor.Talk("Press Y to oblige");
actor.Talk("Press N to take pity on mental state");
var button;
var VK_Y;
var VK_N;
if(Keyboard.IsKeyDown(VK_Y))
{
button.Press(VK_Y);
actor.Talk("Why do you do this to me?");
actor.Direction = DI_UPRIGHT;
Game.PlaySound("sound\event.ogg");
var ent = Scene.GetNode("toy_big");
ent.Active = true;
this.Active = false;
Game.TakeItem("mask");
var EntMask = Scene.GetNode("mask");
EntMask.Active = false;
}
else if(Keyboard.IsKeyDown(VK_N))
{
button.Press(VK_N);
actor.Talk("Thanks for saving my mental state");
}
Game.Interactive = true;
}
-----------------------
I also tried to use VK_UP and VK_DOWN cause I thought that if VK_N and VK_Y aren't mentioned in keys.inc, they might not work. But something is not right with my code. Could you help me please?