GameMaker Circular cooldown

obj_abilities

Information about object: parent_abities
Sprite:
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:

Children
object1
object2
object3
object4
object5
object6
Mask:
No Physics Object

Step Event:
execute code:

if (canSkill==1 &&  mouse_check_button_released(mb_left)&& position_meeting(mouse_x, mouse_y, id)) {
timer = room_speed * second
canSkill=0;
}

if (canSkill==0 && timer > 0) {
timer--;
}

if (canSkill==0 && timer ==0) {

canSkill = 1
}



object1 - object6

Information about object: object1
Sprite: sprite0_Untitled_1 Solid: false Visible: true Depth: 0 Persistent: false Parent: parent_abities Children: Mask:
No Physics Object
Create Event:
execute code:

second = 1
timer = 0
canSkill = 1
Draw Event:
execute code:

draw_sprite(sprite_index, image_index, x, y)

var v;
v = ((timer / (room_speed * second))* 100)/100

if (v < 0) v += 1

draw_set_alpha(0.5)
if (gamemaker_registered)
draw_rectangle_cd(x + 43, y - 43, x - 43, y + 43, v);
else draw_rectangle_cd_lite(x + 43, y - 43, x - 43, y + 43, v)
draw_set_alpha(1)

No comments:

Top 3 UX Design Articles of 2024 to Remember

Based on most subscriptions ͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­...

Contact Form

Name

Email *

Message *