Archived

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

Dunezone

Collision Detection

Recommended Posts

Dunezone    122
Im currently working on a simple dos console game. Like Pacman I have the cursor move around the screen while on a pre-loaded map. My problem is im not sure how to set collision detection to the cursor. Heres my movement code for the cursor if(InputRecord.Event.KeyEvent.wVirtualKeyCode == VK_RIGHT) { CursorPosition.X = CursorPosition.X + 1; CursorPosition.X++; cout << "+"; score = score + 1; } Im sorry if im not very detailed.

Share this post


Link to post
Share on other sites
Dunezone    122
quote:
Original post by blizzard999
Note that you increment CursorPos.x twice!

Simply use (x,y) to access your map...where is the problem?


Is that why my cursor might be going over and down two spots? Because if thats why im very very happy right now.

http://home.comcast.net/~dunezone/main.cpp

Thats the complete source code. I just cant figure out how to implement collision detection between the map and the cursor.

Share this post


Link to post
Share on other sites