Jump to content


Photo

some questions


  • Please log in to reply
2 replies to this topic

#1 GreenhornGames

GreenhornGames

    GMC Member

  • GMC Member
  • 730 posts
  • Version:GM8

Posted 30 March 2012 - 05:02 PM

1. how can i set a timer of 5 seconds in which you need to make your decision of either Rock, Paper or Scissors? after you choose your move, the AI chooses his move and the winning move executes an attack.

2. how can i make a counter which counts the number of winning streaks and resets if you lose?
  • 0

#2 Noele

Noele

    GMC Mentor

  • GMC Member
  • 2334 posts
  • Version:GM8.1

Posted 30 March 2012 - 06:15 PM

1.
timer = 5*room_speed; // set a 5 second timer at the start of the turn
Step Event
timer -=1;
if(timer == 0){
   // time up code goes here
}
2.
counter = 0; // set to zero at the start
Check / increment at the end.
if(win_streak){
  counter +=1;
}else{
  counter = 0; // reset to zero
}

  • 0

#3 kupo15

kupo15

    GMC Member

  • GMC Member
  • 400 posts

Posted 30 March 2012 - 06:16 PM

1. use an alarm.
alarm[0] = 5 * room_speed // 5 seconds
2.
// create
streak = 0

// whatever code determines a win 
if win streak += 1 else streak = 0

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users