Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
General
»
How can I make looped map?
Print
Pages: [
1
]
Author
Topic: How can I make looped map? (Read 1330 times)
0 Members and 1 Guest are viewing this topic.
test
Newbie
Posts: 4
How can I make looped map?
«
on:
October 10, 2015, 10:06:28 am »
I'm making side scrolling game and i want to loop my map, so when the player goes right, map repeats infinitely and enemies, coins and so on generate randomly. How can I do it with SFML?
(click to show/hide)
Sorry for my english
«
Last Edit: October 10, 2015, 10:40:42 am by test
»
Logged
Satus
Guest
Re: How can I make looped map?
«
Reply #1 on:
October 10, 2015, 01:08:40 pm »
Read this book, there's an example of how to implement what you want:
https://www.packtpub.com/game-development/sfml-game-development
Logged
eXpl0it3r
SFML Team
Hero Member
Posts: 11016
Re: How can I make looped map?
«
Reply #2 on:
October 10, 2015, 04:29:52 pm »
If you just want to repeatedly move the background, you just make it longer than the window size and after a certain threshold you reset its position.
If you also have objects flying around, you could rest their position as well.
Logged
Official FAQ:
https://www.sfml-dev.org/faq.php
Official Discord Server:
https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog:
https://duerrenberger.dev/blog/
test
Newbie
Posts: 4
Re: How can I make looped map?
«
Reply #3 on:
October 10, 2015, 05:28:39 pm »
Thanks, guys. I'll try this.
Logged
Hapax
Hero Member
Posts: 3379
My number of posts is shown in hexadecimal.
Re: How can I make looped map?
«
Reply #4 on:
October 12, 2015, 06:03:26 pm »
I wonder if this may also be of use to you:
http://en.sfml-dev.org/forums/index.php?topic=14382.msg101171#msg101171
Logged
Selba Ward
-SFML drawables
Cheese Map
-Drawable Layered Tile Map
Kairos
-Timing Library
Grambol
*
Hapaxia Links
*
Print
Pages: [
1
]
SFML community forums
»
Help
»
General
»
How can I make looped map?