Spawn point and check point SFML

Started by
2 comments, last by LordRhys 10 years, 2 months ago

Hello everyone,

I am making a maze game and I got some problems with spawn point of my player sprite. The player will control the sprite through the maze using the mouse. The problem is that I want my player to start from a point not to start from where player clicked play button. I don't know if I can explain it that you guys can understand... rolleyes.gif I will add images.

Here is my main menu.

[attachment=19799:main menu.PNG]

When play is clicked, game starts, and because my sprite will be rendered at mouse position, sprite will move at last mouse coords.

This is the problem. I want the player to start from the down-right corner not from middle of the screen..

[attachment=19800:start 1.PNG]

Notes:

"Don't gain the world and lose your soul. Wisdom is better than silver or gold." - Bob Marley

Advertisement

When processing your "Play" click, you'll want to set the position of the mouse cursor to your spawn point. A quick google search led me to this post about how to do that in SFML:

http://stackoverflow.com/questions/7860034/how-can-i-change-the-position-of-the-mouse-cursor-in-opengl-sfml

Good luck!

- Eck

EckTech Games - Games and Unity Assets I'm working on
Still Flying - My GameDev journal
The Shilwulf Dynasty - Campaign notes for my Rogue Trader RPG

When processing your "Play" click, you'll want to set the position of the mouse cursor to your spawn point. A quick google search led me to this post about how to do that in SFML:

http://stackoverflow.com/questions/7860034/how-can-i-change-the-position-of-the-mouse-cursor-in-opengl-sfml

Good luck!

- Eck

Thank you very much! I searched on google before but didn't returned me any useful results.

"Don't gain the world and lose your soul. Wisdom is better than silver or gold." - Bob Marley

other thing you may want to look into is State machines, you really should have that start menu screen in a different state from your actual play screen this way the click on the Play button has no effect on your play screen and you player sprite will spawn in where you specified.

This topic is closed to new replies.

Advertisement