Skip to main content
gamedev.net
🔒 Locked

Collision Detection

Started by Dunezone Jan 4, 2004 at 5:55 PM 1 replies 300+ views
Original Post
Dunezone
Dunezone
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.
blizzard999
blizzard999
Note that you increment CursorPos.x twice!

Simply use (x,y) to access your map...where is the problem?
Dunezone
Dunezone
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.