Jump to content
IGNORED

Help with simple math equation, please


Captain Spazer

Recommended Posts

I am incompetent when it comes to math, hoping someone more adept could help me out with this one:

Code for collision detection for 8x8 sprite, need it to be for a 16x8 sprite
 

rem player moves right
   if !joy0right then goto __Skip_Joy0_Right


   if player1x >= _P_Edge_Right then goto __Skip_Joy0_Right


   temp5 = (player1y-1)/8

   temp6 = (player1x-9)/4

   if temp6 < 34 then if pfread(temp6,temp5) then goto __Skip_Joy0_Right

   temp3 = (player1y-8)/8

   if temp6 < 34 then if pfread(temp6,temp3) then goto __Skip_Joy0_Right

__Skip_Joy0_Right


 rem player moves left

   if !joy0left then goto __Skip_Joy0_Left


   if player1x <= _P_Edge_Left then goto __Skip_Joy0_Left


   temp5 = (player1y-1)/8

   temp6 = (player1x-18)/4

   if temp6 < 34 then if pfread(temp6,temp5) then goto __Skip_Joy0_Left

   temp3 = (player1y-8)/8

   if temp6 < 34 then if pfread(temp6,temp3) then goto __Skip_Joy0_Left

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...