delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/08/02:08:16

Message-ID: <001001bf599a$cefd36c0$11bab0c7@oemcomputer>
From: "Gosack" <dannyg AT manistee-isd DOT k12 DOT mi DOT us>
To: <djgpp AT delorie DOT com>
Subject: newbie simple collision help!!!
Date: Sat, 8 Jan 2000 00:39:47 -0500
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 4.72.3110.1
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Reply-To: djgpp AT delorie DOT com

This is a multi-part message in MIME format.

------=_NextPart_000_0006_01BF5970.DDABDB60
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Howdy,
I'm a newbie game programmer. I was wondering if I could
have some help with sprite collisions...
basically x and y are positions for sprite one
and naturally x2 and y2 are positions for sprite 2
could somebody help me with the whole bounding box thing
like just a little code or append to this code.
I just want it so when the two sprites bump into each=20
other they stop.  The sprites I have are 64X64...pretty
standard. I KNOW this is really simple I just don't know
where to start.....
any help would be GREATLY appreciated!!!!!
THANKS!!!!!!!!!!
// Control for Player 1
  if(key[KEY_LEFT]&& x!=3D0)
   x++;
  if(key[KEY_RIGHT] && x!=3D -575)
   x--;
  if(key[KEY_UP] && y!=3D0)
   y++;
  if(key[KEY_DOWN] && y!=3D-330)
   y--;
  =20

// Control for Player 2
  if(key[KEY_A] && x2!=3D 0)
   x2++;
  if(key[KEY_D] && x2 !=3D -575)
   x2--;
  if(key[KEY_W] && y2 !=3D 0)
   y2++;
  if(key[KEY_S] && y2 !=3D -330)
   y2--;
THANKS AGAIN!!!
Gosack

------=_NextPart_000_0006_01BF5970.DDABDB60
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.72.3110.7"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#000000 size=3D2>Howdy,<BR>I'm a newbie game =
programmer. I was=20
wondering if I could<BR>have some help with sprite =
collisions...<BR>basically x=20
and y are positions for sprite one<BR>and naturally x2 and y2 are =
positions for=20
sprite 2<BR>could somebody help me with the whole bounding box =
thing<BR>like=20
just a little code or append to this code.<BR>I just want it so when the =
two=20
sprites bump into each <BR>other they stop.&nbsp; The sprites I have are =

64X64...pretty<BR>standard. I KNOW this is really simple I just don't=20
know<BR>where to start.....<BR>any help would be GREATLY=20
appreciated!!!!!<BR>THANKS!!!!!!!!!!<BR>// Control for Player =
1<BR>&nbsp;=20
if(key[KEY_LEFT]&amp;&amp; x!=3D0)<BR>&nbsp;&nbsp; x++;<BR>&nbsp;=20
if(key[KEY_RIGHT] &amp;&amp; x!=3D -575)<BR>&nbsp;&nbsp; x--;<BR>&nbsp;=20
if(key[KEY_UP] &amp;&amp; y!=3D0)<BR>&nbsp;&nbsp; y++;<BR>&nbsp; =
if(key[KEY_DOWN]=20
&amp;&amp; y!=3D-330)<BR>&nbsp;&nbsp; y--;<BR>&nbsp;&nbsp; </FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>// Control for Player 2<BR>&nbsp; =
if(key[KEY_A]=20
&amp;&amp; x2!=3D 0)<BR>&nbsp;&nbsp; x2++;<BR>&nbsp; if(key[KEY_D] =
&amp;&amp; x2=20
!=3D -575)<BR>&nbsp;&nbsp; x2--;<BR>&nbsp; if(key[KEY_W] &amp;&amp; y2 =
!=3D=20
0)<BR>&nbsp;&nbsp; y2++;<BR>&nbsp; if(key[KEY_S] &amp;&amp; y2 !=3D=20
-330)<BR>&nbsp;&nbsp; y2--;<BR>THANKS=20
AGAIN!!!<BR>Gosack</FONT></DIV></BODY></HTML>

------=_NextPart_000_0006_01BF5970.DDABDB60--

- Raw text -


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