Re: the best way to make random events happen in my python game?

So, when you're to do such a thing, you need to know where exactly to put the variable. Nice one to ask because there are cases that programmers make a mess of their program's processor usage due to improperly placed code.
You need to go through everything that's happening in your game to find out where to place your code. Do you ever call the function specifies that the player is won right after starting the game? Of course not. This is a similar situation. The right place to put your code is where the computer finishes playing a turn. So right after that you randomize the variable, and right after that, you process it by specifying like if the value is 1 continue, end turn otherwise. And that's of course not inside your while loop scope. That should go in the condition or the function that specifies that the computer has just played.
I hope it could help. I can't help more unless I have the code.

-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : ashleygrobler04 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : SkyGuardian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : ashleygrobler04 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : kianoosh via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : ashleygrobler04 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : ashleygrobler04 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : omer via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : philip_bennefall via Audiogames-reflector

Reply via email to