help overhere with computer taking turns

azavegaazavega Member Posts: 362
edited November -1 in Working with GS (Mac)
I got the computer taking turns already but now sometime when is computer's turn it takes forever to shoot. can somebody give a hint why? is it a gamesalad bug or something? cause the algorithm I'm using its pretty simple, or is that the object sometimes when i shoot it never stops? cause looks like it is shaking sometimes... please give me a hint here...

Comments

  • forkliftforklift Member Posts: 386
    When the computer moves, is it governed by a timer or a set of rules? Can't help much without knowing a bit of how you're doing this.
  • ChaserChaser Member Posts: 1,453
    I can't help but before somebody tells you harshly please be more descriptive in your title
  • azavegaazavega Member Posts: 362
    sorry guys... ok when i shoot i set an attribute cmpu_turn to 0 and then when object.motion.linearvelocity.x=0 and object.motion.linearvelocity.y=0 the comp its suppose to shoot that guaranties that the object stops moving so its comp turn. but sometimes its taking to long
  • azavegaazavega Member Posts: 362
    when the comp shoot that attribute comp_turn goes to 1 so its my turn now
  • RattleheadRattlehead Member Posts: 485
    If you are relying on a number of different variables to conditional determine if the CPU should perform some action, I would recommend using some dummy actors with Display Text statements right on the screen so that while testing you can see if the variables hold values that you are expecting.

    I am guessing they might be producing unreliable results or results that are possibly being changed by other rules...
  • forkliftforklift Member Posts: 386
    If the computer opponent has a ton of rules, perhaps setting up an 'otherwise' statement in the player will simplify the # of statements in the computer's turn.

    player's turn
    -if: object.motion.linvervelocy.x >0 AND object.motion.linearvelocity.y>0
    -then: cmpu_turn = 0
    *
    - otherwise cmpu_turn = 1

    *EDIT* or something of the sort. I don't know all the conditions of the turns, but hopefully you get the idea.
  • azavegaazavega Member Posts: 362
    ok thanks guys ill keep trying...
Sign In or Register to comment.