| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- /// @description init menu
- enum STATE
- {
- INIT,
- SELECT,
- ACTIVATE,
- WAIT,
- ATTACK,
- TEST
- }
- state = STATE.INIT;
- win_width = window_get_width();
- win_height = window_get_height();
- // Cards in hand
- card_hand = [];
- card_selected = 0;
- card_change = 0;
- // Spawn Card
- for(i=0; i<=4; i+=1;)
- {
- card = instance_create_depth(0, 0, -600, obj_card);
- array_push(card_hand, card);
- spacing = i * 4;
-
- with(card)
- {
- x = other.i * width + other.spacing + 50;
- y = other.win_height - height;
-
- if (other.i == 0)
- selected = true;
- }
- }
- // Spawn Mobs
- mobs_nb = irandom_range(1, 4);
- for (mob_i=0; mob_i<mobs_nb; mob_i++;)
- {
- var _mob_inst = instance_create_depth(0, 0, -500, obj_enemy)
-
- with(_mob_inst)
- {
- // centering the mobs onscreen
- var _all_mobs_width = sprite_width * other.mobs_nb + 20;
- var _mobs_leftmost = get_win_midx(_all_mobs_width);
- var _relative_x = (_all_mobs_width / other.mobs_nb) * other.mob_i;
- x = _mobs_leftmost + _relative_x;
- }
- }
- // Spawn Hero
- instance_create_depth(0, 0, 40, obj_player);
|