Wednesday, 7 April 2021

【GAMEMAKER】Dice Roll

 Information about object: obj_roll_dice

Sprite:
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Create Event:
execute code:

rolling=false;
dice1=1;
dice2=1;
Alarm Event for alarm 0:
execute code:

rolling=false;
Step Event:
execute code:

if keyboard_check_released(ord('R')) && !rolling
{
rolling=true;
alarm[0]=room_speed*4;
}

if rolling
{
dice1=irandom(5);
dice2=irandom(5);
}
Draw Event:
execute code:

draw_sprite(spr_dice,dice1,200,200);
draw_sprite(spr_dice,dice2,400,200);
if !rolling draw_text(50,50,"Press R to Roll#Last Roll "+string(dice1+dice2+2));

No comments:

Post a Comment

BREAKING: North Carolina automotive group acquires 7 Upstate dealerships

Breaking news from GSA Business Report Click here to view this message in a browser window. ...