delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/01/08:34:14

From: "Stormy" <stormy AT your DOT mommas DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Collision Detection
Date: 29 Jun 1997 05:08:20 GMT
Organization: Info Avenue INTERNET Access
Lines: 32
Message-ID: <01bc844b$c81ba5c0$4c6c74cc@digital.twlakes.net>
NNTP-Posting-Host: 204.116.108.76
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I have 2 structures which follow:
struct
{
  int min_x;
  int max_x;
  int min_y;
  int max_y;
}TILES[30][40];

and

struct
{
  int min_x;
  int max_x;
  int min_y;
  int max_y;
}CARBOX;

I am in screen mode 640x480 using the allegro library..
all my tiles are 16x16, and I store the coords of all of them in the first
struct.

I store all the coords at any point in time for the car's
x & y values in the 2nd one.. I want to be able to cheq
if the car can move or not.. and the car moves 6 pixels at a time in any
direction.  Also the car can only not move if the tile is of type 1 which
is figured out from another structure.. which means its solid.. I just need
some example code how to tell if the car can move or not.

pleeze help me.. Ken.. email me at: storm3 AT geocities DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019