Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
General
»
Gamestates - in which order?
Print
Pages: [
1
]
Author
Topic: Gamestates - in which order? (Read 2075 times)
0 Members and 1 Guest are viewing this topic.
Bizarreofnature
Newbie
Posts: 48
Gamestates - in which order?
«
on:
February 18, 2018, 04:39:25 pm »
Hello!
Ive got 4 states of my game.
1. update
2. check collision
3. spawn enemies
4. draw
And I wonder in which order I should put these.
I am sorry If something like this post has been written already 100 times.
What can I say, Im a nab
Best regards,
Bizarreofnature
Logged
Bizarreofnature
Newbie
Posts: 48
Re: Gamestates - in which order?
«
Reply #1 on:
February 18, 2018, 04:51:36 pm »
Oh i see.
1. update
2. collision
3. draw
but where to put spawn enemies?
Logged
Paul
Jr. Member
Posts: 78
Re: Gamestates - in which order?
«
Reply #2 on:
February 19, 2018, 01:12:00 am »
It depends on your game loop. The basis is not to have any complex code in the draw procedure. So you can put spawning into update phase or make some event queue.
Logged
NGM88
Full Member
Posts: 162
Re: Gamestates - in which order?
«
Reply #3 on:
February 20, 2018, 07:16:50 am »
You probably want to update your spawned enemies before drawing them. I don't know what how you coded the game but I can imagine a few instances where your enemies are drawn incorrectly for the first frame they are spawned.
Logged
Print
Pages: [
1
]
SFML community forums
»
Help
»
General
»
Gamestates - in which order?
anything