SFML community forums

Help => General => Topic started by: BeautiCode on August 11, 2014, 07:37:45 pm

Title: I have a game in mind but...
Post by: BeautiCode on August 11, 2014, 07:37:45 pm
I have a game I want to make, in mind.
But I have a few questions.
1. How does one make a game where the character would walk and the map would move as he walks?  (Basically like a top/bottom and side-scroller combined)
2. How does a sprite get affected if I make the sprite a certain size and intend it for full-screen, but then I decide to add a feature that allows the user to resize the window?
Title: Re: I have a game in mind but...
Post by: Bloob on August 11, 2014, 07:49:02 pm
I think you might want to read the SFML view tutorials.

http://www.sfml-dev.org/tutorials/2.1/graphics-view.php
Title: Re: I have a game in mind but...
Post by: BeautiCode on August 11, 2014, 09:02:21 pm
Thanks, that helps for the first one.
Title: Re: I have a game in mind but...
Post by: Bloob on August 11, 2014, 09:17:10 pm
Thanks, that helps for the first one.

Scroll down to "Showing more when the window is resized". Does that answer your question?
Title: Re: I have a game in mind but...
Post by: BeautiCode on August 12, 2014, 04:49:18 am
I guess, thanks.
One more question, I wanna make a big map.
Its not just gonna be some patches of land that I can put in a tilemap and set it up as little squares. but an actual map with different size buildings and stuff. How would I set that up? Do I just make the whole map in photoshop and load it as one big sprite, then set custom point boundaries for the buildings and stuff? Or..
Title: Re: I have a game in mind but...
Post by: Ztormi on August 12, 2014, 09:31:08 am
...
Do I just make the whole map in photoshop and load it as one big sprite, then set custom point boundaries for the buildings and stuff? Or..

That could work, but you would have to split the photoshop image into smaller parts if your texture is exceptionally large. The maximum size of texture you can load depends on the graphics card. I generally avoid having textures larger than 1024x1024. I'd say it's probably not worth the hassle.

If tilemaps are out of the question you'd really want to create the terrain from polygons, either randomly generated or with use of tool capable of creating polygons. Pretty much any 3d modeling software can export into .obj file which are really easy to parse into SFML Vertex arrays. Collidable and all special objects you could handle with sprites.

Here's an interesting read http://www-cs-students.stanford.edu/~amitp/game-programming/polygon-map-generation/