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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - OeysteinLO

Pages: [1]
1
Graphics / Re: VertexArray collision?
« on: November 18, 2013, 09:46:43 pm »
Well, i guess i didn't think about that. That seems doable. I would use the coordinates of the player, iterate the VertexArray and check if the corresponding tile is 'collideable'?

Hmm, that would save space, wouldn't it. I guess i didn't think about that either. I haven't been doing this for long, so i guess that will be my excuse...

2
Graphics / VertexArray collision?
« on: November 18, 2013, 08:59:08 pm »
Hello

I am making a platformer game with my friends and i am looking into ways of making a map. Last year we made something very simple where the map was made from sf::Rect object, and we detected collisions using the intersects method.
We can do that again, but i am also interested in a tileMap using a vertex array. I dont want to use too much time just trying it and not getting it to work, so here is my question:

Is there any way to detect collision with distinct quad vertices inside the whole vertex array, or can you only get the outer bounds of the whole thing?

Just so you can easier understand my question:
0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0 0 0 0
1 0 0 0 1 1 1 1 1 0 0 0 0
1 0 0 0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 1 1 1 1 1 1
 

This represents the tilemap. The number 1 will create a quad with a texture and the number 0 will create a quad with no texture, so its transparent.
Is there a way to collide with only the '1' quads and not the '0' quads?

As i said, its no biggie if this wont work, i can just use a similar approach with sf::Rect's instead.

Pages: [1]
anything