Jump to content
  • Advertisement
Sign in to follow this  
bratiefanut

Spawn point and check point SFML

This topic is 2079 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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:

 

Share this post


Link to post
Share on other sites
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

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!