Archived

This topic is now archived and is closed to further replies.

savagery

Colision detection with the Screen

Recommended Posts

savagery    122
I got a game I made in DOS, RPG 2D 256 colors, I want to port it to Windows 16-bit using DDRAW, (Í am new to this stuff), I used to check for a specific color in the screen, which I defiened to be the boundary for the background BMP, like rocks and trees, then I checked if It was inside the sprite so I dont let it walk that direction, BUT, now in 16bit Its just slow...any sugestions, Tutorials, coments will be apreciated (and sorry for the grammar)

Share this post


Link to post
Share on other sites
Amythius    122
I would suggest some sort of algorithm for detecting the boundaries of the screen.
First : Make globals of your screen size in your file.
#define SCREEN_WIDTH ###
#define SCREEN_HEIGHT ###

Then, when initialize your window, use these globals to set your screen values for its size.

Then, in you detection algorithm... Just detect if your player or whatever has hit SCREEN_WIDTH - 1 || SCREEN_HEIGHT -1

Thats just my guess, Im running late, so this reply is pretty bad. I hope this helps.

Share this post


Link to post
Share on other sites
Amythius    122
I would suggest some sort of algorithm for detecting the boundaries of the screen.
First : Make globals of your screen size in your file.
#define SCREEN_WIDTH ###
#define SCREEN_HEIGHT ###

Then, when initialize your window, use these globals to set your screen values for its size.

Then, in you detection algorithm... Just detect if your player or whatever has hit SCREEN_WIDTH - 1 || SCREEN_HEIGHT -1

Thats just my guess, Im running late, so this reply is pretty bad. I hope this helps.


Also, I would like to see your game, I''m always interested.

Share this post


Link to post
Share on other sites