Search found 16 matches

by jjackdev
Wed Feb 09, 2011 4:43 pm
Forum: Programming Discussion
Topic: How to get the x coordinate and y coordinate of tilesheet
Replies: 12
Views: 1294

Re: How to get the x coordinate and y coordinate of tilesheet

Thank you for the help but it was Tiled which was outputing wierd GIDS which were one more than what they should be and for the first row they were fine.
by jjackdev
Wed Feb 09, 2011 2:10 pm
Forum: Programming Discussion
Topic: How to get the x coordinate and y coordinate of tilesheet
Replies: 12
Views: 1294

Re: How to get the x coordinate and y coordinate of tilesheet

I tried the modulo and division to find the x and y and it worked but not the way I wanted it to. It gave me the wrong tile. I then tried creating a 2d array full of indexes and that gave me the results like the modulo and division way. I imagine that maybe my texture coordinate generation for openG...
by jjackdev
Tue Feb 08, 2011 8:57 pm
Forum: Programming Discussion
Topic: How to get the x coordinate and y coordinate of tilesheet
Replies: 12
Views: 1294

How to get the x coordinate and y coordinate of tilesheet

I currently have a problem finding the x and y coordinates of a tilesheet with a Tile Id or index. What I need is a way to get the x index and y index of a tile on a tilesheet from an index.
by jjackdev
Tue Sep 14, 2010 5:48 pm
Forum: Programming Discussion
Topic: OpenGL fade effect
Replies: 20
Views: 10593

Re: OpenGL fade effect

WSPSNIPER : Thank you so much I used your new updated method and it works even with the warp.Thank you so much
by jjackdev
Tue Sep 14, 2010 3:07 pm
Forum: Programming Discussion
Topic: OpenGL fade effect
Replies: 20
Views: 10593

Re: OpenGL fade effect

Just ignore the if (fading) break; thing that is just a test to see if it will work but it doesn't. I got it to work I think it has to do with SDL and the OpenGL not communicating.
by jjackdev
Mon Sep 13, 2010 10:18 pm
Forum: Programming Discussion
Topic: OpenGL fade effect
Replies: 20
Views: 10593

Re: OpenGL fade effect

Its in the code I posted earlier. It looks like this. for (int i = 0; i < TILE_SOLID_COUNT; i++) { if (IsCollision(tileRect[i], playerRect) == true) { collision = true; if (i == 33) { //Collision with the warp x = 303; //Set to center y = 223; //Set to center alpha = 0.0f; //Set the alpha to zero fa...
by jjackdev
Mon Sep 13, 2010 10:08 pm
Forum: Programming Discussion
Topic: OpenGL fade effect
Replies: 20
Views: 10593

Re: OpenGL fade effect

Let me tell you the whole problem. 1. I check to see if there are any collisions (that works) 2. I see if the collision is a certain collider (that works) 3. I then fade it while warping the character (the warp works not the fade) The problem with the fade is it just stays completely black but when ...
by jjackdev
Mon Sep 13, 2010 9:30 pm
Forum: Programming Discussion
Topic: OpenGL fade effect
Replies: 20
Views: 10593

Re: OpenGL fade effect

I fixed it in my code but it did not work? I just need a solution for my current solution.
by jjackdev
Mon Sep 13, 2010 9:18 pm
Forum: Programming Discussion
Topic: OpenGL fade effect
Replies: 20
Views: 10593

Re: OpenGL fade effect

I tried your method WSPSNIPER but my computer froze. But here is the problem so I am testing a warp like thing like this. for (int i = 0; i < TILE_SOLID_COUNT; i++) { if (IsCollision(tileRect[i], playerRect) == true) { collision = true; if (i == 33) { x = 303; y = 223; alpha = 0.0f; fading = true; f...
by jjackdev
Mon Sep 13, 2010 8:18 pm
Forum: Programming Discussion
Topic: OpenGL fade effect
Replies: 20
Views: 10593

Re: OpenGL fade effect

Well I have implemented it but some stuff isn't working like when you have the fade it will just be pure black but when you press any of the keys it will actually do the fade. Any tips. I am using SDL and OpenGL with C++ with Xcode on a Mac.
by jjackdev
Mon Sep 13, 2010 7:52 pm
Forum: Programming Discussion
Topic: OpenGL fade effect
Replies: 20
Views: 10593

Re: OpenGL fade effect

Yes a fade to black effect in OpenGL.
by jjackdev
Mon Sep 13, 2010 6:10 pm
Forum: Programming Discussion
Topic: OpenGL fade effect
Replies: 20
Views: 10593

OpenGL fade effect

How would you do an opengl fade effect? I've seen methods that suggest creating a huge rectangle but I don't know how to do the fade. Any help is appreciated.

Thanks
by jjackdev
Thu Sep 02, 2010 11:31 pm
Forum: Game Development
Topic: 2d tilemap collision
Replies: 4
Views: 971

Re: 2d tilemap collision

Thanks for all of the help but I figured that I could just use some static Rects and test a collision with them with the player rect.
by jjackdev
Thu Sep 02, 2010 1:20 pm
Forum: Game Development
Topic: 2d tilemap collision
Replies: 4
Views: 971

Re: 2d tilemap collision

Alright thanks for the help here is the code for the matrix 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 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 ...
by jjackdev
Wed Sep 01, 2010 10:56 pm
Forum: Game Development
Topic: 2d tilemap collision
Replies: 4
Views: 971

2d tilemap collision

Ok so I have been trying to create a way to have solid tiles in my game. Here is some of the code for the collision that I am using. bool IsCollision(SDL_Rect r1, SDL_Rect r2 ) { if ( r1.x < r2.x+r2.w && r1.x+r1.w > r2.x && r1.y < r2.y+r2.h && r1.y+r1.h > r2.y ) { return true...