Pacman-style Maze Collision Detection

This is a discussion on Pacman-style Maze Collision Detection within the Game Programming forums, part of the General Programming Boards category; Hello, While this site was down, I did something rather silly:- tried to make a game in DOS assembly language. ...

  1. #1
    Registered /usr
    Join Date
    Aug 2001
    Location
    Newport, South Wales, UK
    Posts
    1,262

    Question Pacman-style Maze Collision Detection

    Hello,

    While this site was down, I did something rather silly:- tried to make a game in DOS assembly language. Worse still, I have practically no experience in assembly language programming...

    Nevertheless, I managed to get some double-buffering going, drew a maze to the back buffer and got a object moving with the cursor keys. Unfortunately, the detection of where the object is in the maze seems to be a bit messed up, as when you want to turn through a hole in a wall, it doesn't go until it's a tile past it, then you lose control completely and it just flies off the screen.

    I've taken the liberty of expanding what code I'd written into Windows C so you people could digest what's going on without scratching your head at Intel instructions. The code is attached.

    Can anyone help me with this?
    Attached Files Attached Files

  2. #2
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,596
    DOS assembly language eh. What's that. I know about x86 assembly language but no DOS assembly.

    Just kidding, I know what you mean but assembly is not related to DOS at all.

    Seems that your one tile off in your sprite's or something. Shouldn't be too hard to fix.

  3. #3
    Registered /usr
    Join Date
    Aug 2001
    Location
    Newport, South Wales, UK
    Posts
    1,262
    Originally posted by Bubba
    DOS assembly language eh. What's that. I know about x86 assembly language but no DOS assembly.

    Just kidding, I know what you mean but assembly is not related to DOS at all.
    I know, but the BIOS doesn't give you Interrupt 21h, DOS does, so it won't work without DOS or DOS-compatible OS.

  4. #4
    RoD
    RoD is offline
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    I second bubba your sprites are off i think.

  5. #5
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,596
    try this:

    Code:
    int sprite_center_x=sprite_x+half_imagewidth_x;
    int sprite_center_y=sprite_y+half_imageheight_y;
    
    TestForHit(sprite_center_x,sprite_center_y);

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Collision Detection Problems
    By Dark_Phoenix in forum Game Programming
    Replies: 1
    Last Post: 12-17-2006, 02:25 PM
  2. breakout style game collision detection
    By m00se123 in forum Game Programming
    Replies: 6
    Last Post: 10-31-2002, 08:18 AM
  3. bounding box collision detection
    By DavidP in forum Game Programming
    Replies: 7
    Last Post: 07-07-2002, 11:43 PM
  4. collision detection
    By DavidP in forum Game Programming
    Replies: 2
    Last Post: 05-11-2002, 01:31 PM
  5. Replies: 4
    Last Post: 05-03-2002, 09:40 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21