J
JulianW
Guest
So I'm doing an assignment for Uni and we have been told to make a simple mechanic in GMS2.
My mechanic idea is a simple stupid idea of find the button.
I've made the map/background, the player, lighting and a button.
I've also made a sprite with text in saying door is now unlocked.
What I want to be able to do is click the button then the button disappears and the text appears.
This is what I have so far for the button script.
Left Pressed:
buttonClicked = false;
d = point_distance(mouse_x, mouse_y, self.x + (self.sprite_width/2), self.y + (self.sprite_height)/2)
if (d < self.sprite_width/2) {
instance_destroy()
buttonClicked = true;
}
if (buttonClicked==true){
draw_sprite(spr_DoorIsUnlocked, 0, 490, 380);
}
The button disappears but the sprite with text on doesn't appear? any advice on that?
Here's a short video of what's going on.
I also want to add some sort of if you click the mouse somewhere then a ring will appear and the player will move to that area. I've got the click and move bit done just not able to get a ring to appear.
My mechanic idea is a simple stupid idea of find the button.
I've made the map/background, the player, lighting and a button.
I've also made a sprite with text in saying door is now unlocked.
What I want to be able to do is click the button then the button disappears and the text appears.
This is what I have so far for the button script.
Left Pressed:
buttonClicked = false;
d = point_distance(mouse_x, mouse_y, self.x + (self.sprite_width/2), self.y + (self.sprite_height)/2)
if (d < self.sprite_width/2) {
instance_destroy()
buttonClicked = true;
}
if (buttonClicked==true){
draw_sprite(spr_DoorIsUnlocked, 0, 490, 380);
}
The button disappears but the sprite with text on doesn't appear? any advice on that?
Here's a short video of what's going on.
I also want to add some sort of if you click the mouse somewhere then a ring will appear and the player will move to that area. I've got the click and move bit done just not able to get a ring to appear.