# somebodykulj

Members

21

100 Neutral

• Rank
Member
1. ## How to know from what side did the rect's collide?

I use SDL rects, for the first two paramterers, but i dont know what are the other 2 parameters: CThunderTileVector* pvecOutPenetration, const CThunderTileVector* pvecMovement What are these 2 parameters used for?
2. ## How to know from what side did the rect's collide?

int check_cool_collision( SDL_Rect &A, SDL_Rect &B ) { int leftA, leftB; int rightA, rightB; int topA, topB; int bottomA, bottomB; leftA = A.x; rightA = A.x + A.w; topA = A.y; bottomA = A.y + A.h; leftB = B.x; rightB = B.x + B.w; topB = B.y; bottomB = B.y + B.h; if( bottomA <= topB ) { return -23; } else return 7; if( topA >= bottomB ) { return -23; } else return 8; if( rightA <= leftB ) { return -23; } else return 9; if( leftA >= rightB ) { return -23; } else return 10; } This is what i wrote and then realised that it doesent work? How can this be done?
3. ## Help with basic platform physics...

I have tried that, but no it doesent do what i want, i want the player to keep moving in high speed BUT when i am controlling him int the air then da playa may not move so much.
4. ## Help with basic platform physics...

I have made a simple platform game that when press space jumps when press ctrl accelerates and with acceleration the jump is higher and when i jump so high with acceleration and try to control where the player would land i get tooo much control becouse when i press right or left the player moves around the x axis just as fast as on the gorund and it looks bad, the bottom line is that when i start the jump the player will jump allong the x axis and acceleration but when a key is pressed during the jump i want to be able to controlle the player BUT not so much so that it looks like he can fly. here is my code... if(lockjump==true )//SIMULACIJA GRAVITACIJE U VAZDUHU { if(xtime%200==0) { velx*=0.9; } } else velx*=0.000099; if(keystates[SDLK_RIGHT]) { velx = VELMOVING; faceright = true; W_RIGHT=true; } else W_RIGHT=false; if(keystates[SDLK_LEFT]) { velx =-VELMOVING; faceright = false; W_LEFT=true; } else W_LEFT=false; if(keystates[SDLK_SPACE] && !lockjump) { ON_GROUND==false; vely = -VELJUMP; lockjump = true; jumping = true; } if(keystates[SDLK_LCTRL] && (W_LEFT==true || W_RIGHT==true)) { if (lockjump==false) { if (VELMOVING<15) { VELMOVING+=0.5; } if (VELJUMP<25 ) { if(xtime%3==0) VELJUMP+=1; } } } else { if (VELMOVING > 4) VELMOVING-=1; if (VELJUMP>15) VELJUMP-=1; } xtime is my way of cehcking the time it ads up 1 on every main loop... i need to be able to control the player when making an accelerated jump BUT not too much...

I dont understand this? what is the SDL_RWops??? I'm sorry but i just dont get it?

I want to protect the art no matter what i know it can be hacked but very few can do so. So haw can i load an image??? what should i do to make this work with SDL??? Quote: One method would be to use PHYSFSRWOPS_openRead() to open the file and IMG_Load_RW() to load the image from the SDL_RWops. i dont understand this?? can you give me some more detail?

I dont quite understand how it works... if i do this PHYSFS_file* myfile = PHYSFS_openRead("myfile.txt"); can i pass myfle to SDL_LoadBMP(char* ...)??? What do i need to give my SDL_LoadBMP??

I want to protect my artwork by locking it up in a ZIP or some other archive and then read them in my game, how do i do this?
9. ## How to save a bmp image with SDL?

Thanks!!!!! [Edited by - somebodykulj on April 10, 2008 7:23:42 AM]
10. ## How to save a bmp image with SDL?

I want to load a image and then save it somewere else? How can i do this in SDL?
11. ## Platform tile game collision (slopes)

I have just made a great tile collision system for my platform game and i wanted to take it further! to make a 45 degree slope tile on the left and right, does anybody know how to do this?
12. ## 2D Platform Mario game collision.

Thanks, i wrota a function myself... here it is but it doesent work :( WHY??? int check_cool_collision( SDL_Rect &A, SDL_Rect &B ) { int leftA, leftB; int rightA, rightB; int topA, topB; int bottomA, bottomB; leftA = A.x; rightA = A.x + A.w; topA = A.y; bottomA = A.y + A.h; leftB = B.x; rightB = B.x + B.w; topB = B.y; bottomB = B.y + B.h; if( bottomA <= topB ) { return -23; } else return 7; if( topA >= bottomB ) { return -23; } else return 8; if( rightA <= leftB ) { return -23; } else return 9; if( leftA >= rightB ) { return -23; } else return 10; } i need this kind of collision that will tell me from which side did i hit the other rectangle.
13. ## 2D Platform Mario game collision.

Yes something like that... but i was way over my head with that i will just use the standard AABB collision test.
14. ## 2D Platform Mario game collision.

Ladies and gentleman i have been officialy fu*ked, i know AABB collision dont you worry about that, i was thinking about another type of collision that is implemented using vector projections and is used for both squares and all other shapes,it is a special type of colision that in the same function has a responce too... not the typical AABB function. I have writen that same function myself and it has not worked, doo to stuff beyond my controle and that is why i was hoping for some C++ code to see where i screwed up, but no matter now i have thought of a way of making this a little easyer by usign the rectangles center to make a good responce and the AABB system to check the collision.
15. ## 2D Platform Mario game collision.

Why do you come down so hard on me i said it is too much to ask for.. damn I know i have gaps in my knowledge i havent even started learning vectors and trigonometry in school how the hell should i know this sh*t...