O
ocimpean
Guest
I made few buttons with condition switch to navigate between rooms.
Also made second object like a health bar, but I want it to show when the condition switch buttons are clicked and deduct points from global.ex variable.
When counter reaches zero, I would like to go to room_9. Also, I would like the counter bar to be persistent between rooms (so I will convert probably it to draw gui), also I want it to remember the number of points deducted on click from another room, if I decide to navigate between rooms.
And is not working.
By that I mean the counter-bar is drawn, but clicks are not registered.
I am using the code written below, and I would like to ask if any of you more experienced users you can have a look and help me make it work.
Thank you.
//object_button--------------#-----------------------------------------------------
//draw-_-_-_-_
draw_self();
draw_set_colour(c_black);
draw_set_valign(fa_middle);
draw_set_halign(fa_center);
draw_set_font(font1);
draw_text(x,y,text);
//create-_-_-_-
image_speed = 0
global.ex = 100;
global.maxex = 100;
// on left released-_-_-_-_
global.ex = global.ex - 10;
if (global.ex <= 0)
{
room_goto (room_9);
}
switch (action)
{
case 0:
room_goto(room_1);
break;
case 1:
room_goto(room_2);
break;
case 2:
room_goto(room_9);
break;
}
//object_click_button_bar -------------------------------------------------------
//draw
//_-_-_-_
drawWidth = 250;
draw_set_colour(c_yellow);
draw_rectangle(250, 550, 250+(global.ex/global.maxex)*drawWidth , 550+20, false );
draw_set_colour(c_green);
draw_rectangle(250, 550, 250+drawWidth , 550+20, true );
//--------------------
Also made second object like a health bar, but I want it to show when the condition switch buttons are clicked and deduct points from global.ex variable.
When counter reaches zero, I would like to go to room_9. Also, I would like the counter bar to be persistent between rooms (so I will convert probably it to draw gui), also I want it to remember the number of points deducted on click from another room, if I decide to navigate between rooms.
And is not working.
By that I mean the counter-bar is drawn, but clicks are not registered.
I am using the code written below, and I would like to ask if any of you more experienced users you can have a look and help me make it work.
Thank you.
//object_button--------------#-----------------------------------------------------
//draw-_-_-_-_
draw_self();
draw_set_colour(c_black);
draw_set_valign(fa_middle);
draw_set_halign(fa_center);
draw_set_font(font1);
draw_text(x,y,text);
//create-_-_-_-
image_speed = 0
global.ex = 100;
global.maxex = 100;
// on left released-_-_-_-_
global.ex = global.ex - 10;
if (global.ex <= 0)
{
room_goto (room_9);
}
switch (action)
{
case 0:
room_goto(room_1);
break;
case 1:
room_goto(room_2);
break;
case 2:
room_goto(room_9);
break;
}
//object_click_button_bar -------------------------------------------------------
//draw
//_-_-_-_
drawWidth = 250;
draw_set_colour(c_yellow);
draw_rectangle(250, 550, 250+(global.ex/global.maxex)*drawWidth , 550+20, false );
draw_set_colour(c_green);
draw_rectangle(250, 550, 250+drawWidth , 550+20, true );
//--------------------