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

Author Topic: Colissions with tilemap  (Read 1369 times)

0 Members and 1 Guest are viewing this topic.

etixpp

  • Jr. Member
  • **
  • Posts: 82
    • View Profile
    • FoxFire Development Website
    • Email
Colissions with tilemap
« on: June 01, 2013, 02:17:47 pm »
Hello, i am new to sfml and created a tilemap like in the example on tutorial, now i wanted to check collosion from player with something like fence, i know how to do this, at example with player.getglobalbounds() and so on but how can i get globalbounds of special parts of the tile map? I am kinda confused there :/

Tilemap is like Example tilemap here:
http://www.sfml-dev.org/tutorials/2.0/graphics-vertex-array.php
Player ist a normal Sprite ...
Things like running and so on work just fine atm

Locko

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Colissions with tilemap
« Reply #1 on: October 10, 2015, 12:12:41 am »
Did you find a solution on this? Im really interested

Hapax

  • Hero Member
  • *****
  • Posts: 3370
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Colissions with tilemap
« Reply #2 on: October 12, 2015, 06:11:54 pm »
This thread is from two years ago and the poster hasn't logged in for over a year!  :o

The tiles in a tilemap are laid out in a grid so finding their coordinates should be easy enough.

TopLeft: topLeftOfTilemap + (tileColumn * tileSize.x, tileRow * tileSize.y)
BottomRight: TopLeft + tileSize
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*