Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Spawn point and check point SFML

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
3 replies to this topic

#1 Mr. Lawliet   Members   

1467
Like
0Likes
Like

Posted 05 February 2014 - 07:51 AM

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.

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..

start 1.PNG

 

Notes:

 


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

 


#2 Eck   Members   

7511
Like
3Likes
Like

Posted 05 February 2014 - 08:23 AM

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

#3 Mr. Lawliet   Members   

1467
Like
1Likes
Like

Posted 05 February 2014 - 09:42 AM

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

 


#4 LordRhys   Members   

379
Like
2Likes
Like

Posted 07 February 2014 - 07:51 AM

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.




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.