Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Beginner Tile Map 2d  (Read 8350 times)

0 Members and 1 Guest are viewing this topic.

cyberpala

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Beginner Tile Map 2d
« on: February 09, 2014, 02:13:06 pm »
Hello

I'm new here and started programming C++ / SFML 2.1 with VC 2013 today.

I want to start a little project with 2d tile map (loading, Display and moving arround). What is the best way of learning, are ther any sources to learn.

greetings from Germany

cyberpala

blojayble

  • Newbie
  • *
  • Posts: 19
  • whoa
    • View Profile
Re: Beginner Tile Map 2d
« Reply #1 on: February 09, 2014, 02:25:20 pm »
Hi.

First of all, you should start with learning about C++ basics.(if you haven't done it yet)

About SFML, I recommend this book:
http://www.packtpub.com/sfml-game-development/book

There are also a lot of useful tutorials on this website, such as an example of simple 2D tile map here:
http://www.sfml-dev.org/tutorials/2.1/graphics-vertex-array.php

Good luck!
0 bottles of beer on the wall,
0 bottles of beer!
Take one down, pass it around,
4,294,967,295 bottles of beer on the wall!

cyberpala

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: Beginner Tile Map 2d
« Reply #2 on: February 09, 2014, 02:33:20 pm »
Thanks for the quick answer.

C++ isn't the problem.

I'm always reading http://www.sfml-dev.org/tutorials/2.1/graphics-vertex-array.php
but there is an example  tilemap with a png-map, but no link to download this file.

I want to try out the example.

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Beginner Tile Map 2d
« Reply #3 on: February 09, 2014, 04:01:31 pm »
You could create your own. It only needs an image with tiles of size 32 x 32. Since I'm feeling generous, I'm going to provide you with a simple image that should work with that code.
You will have to put save it to your computer, put it in the correct folder/directory, and rename the image or change the filename ("tileset") in this line of the code:
if (!map.load("tileset.png", sf::Vector2u(32, 32), level, 16, 8))


Please note that I am no artist.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

 

anything