Jump to content

Search the Community

Showing results for tags 'collision detection'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Atari Systems
    • Atari General
    • Atari 2600
    • Atari 5200
    • Atari 7800
    • Atari Lynx
    • Atari Jaguar
    • Atari VCS
    • Dedicated Systems
    • Atari 8-Bit Computers
    • Atari ST/TT/Falcon Computers
  • Classic Consoles
  • Classic Computing
  • Modern Consoles
  • Gaming General
  • Marketplace
  • Community
  • Community
  • Game Programming
  • Site
  • PC Gaming
  • The Club of Clubs's Discussion
  • I Hate Sauron's Topics
  • 1088 XEL/XLD Owners and Builders's Topics
  • Atari BBS Gurus's Community Chat
  • Atari BBS Gurus's BBS Callers
  • Atari BBS Gurus's BBS SysOps
  • Atari BBS Gurus's Resources
  • Atari Lynx Programmer Club's CC65
  • Atari Lynx Programmer Club's ASM
  • Atari Lynx Programmer Club's Lynx Programming
  • Atari Lynx Programmer Club's Music/Sound
  • Atari Lynx Programmer Club's Graphics
  • The Official AtariAge Shitpost Club's Shitty meme repository
  • The Official AtariAge Shitpost Club's Read this before you enter too deep
  • Arcade Gaming's Discussion
  • Tesla's Vehicles
  • Tesla's Solar
  • Tesla's PowerWall
  • Tesla's General
  • Harmony/Melody's CDFJ
  • Harmony/Melody's DPC+
  • Harmony/Melody's BUS
  • Harmony/Melody's General
  • ZeroPage Homebrew's Discussion
  • Furry Club's Chat/RP
  • PSPMinis.com's General PSP Minis Discussion and Questions
  • PSPMinis.com's Reviews
  • Atari Lynx 30th Birthday's 30th Birthday Programming Competition Games
  • 3D Printing Club's Chat
  • Drivers' Club's Members' Vehicles
  • Drivers' Club's Drives & Events
  • Drivers' Club's Wrenching
  • Drivers' Club's Found in the Wild
  • Drivers' Club's General Discussion
  • Dirtarians's General Discussion
  • Dirtarians's Members' Rigs
  • Dirtarians's Trail Runs & Reports
  • Dirtarians's Wrenching
  • The Green Herb's Discussions
  • Robin Gravel's new blog's My blog
  • Robin Gravel's new blog's Games released
  • Atari Video Club's Harmony Games
  • Atari Video Club's The Atari Gamer
  • Atari Video Club's Video Game Summit
  • Atari Video Club's Discsuuions
  • Star Wars - The Original Trilogy's Star Wars Talk
  • PlusCart User's Bug reports
  • PlusCart User's Discussion
  • DMGD Club's Incoming!
  • DASM's General
  • AtariVox's Topics
  • Gran Turismo's Gran Turismo
  • Gran Turismo's Misc.
  • Gran Turismo's Announcements
  • The Food Club's Food
  • The Food Club's Drinks
  • The Food Club's Read me first!
  • The (Not So) Official Arcade Archives Club's Rules (READ FIRST)
  • The (Not So) Official Arcade Archives Club's Feedback
  • The (Not So) Official Arcade Archives Club's Rumor Mill
  • The (Not So) Official Arcade Archives Club's Coming Soon
  • The (Not So) Official Arcade Archives Club's General Talk
  • The (Not So) Official Arcade Archives Club's High Score Arena
  • Adelaide South Australia Atari Chat's General Chat & Welcome
  • Adelaide South Australia Atari Chat's Meets
  • Adelaide South Australia Atari Chat's Trades & Swaps
  • KC-ACE Reboot's KC-ACE Reboot Forum
  • The Official Lost Gaming Club's Lost Gaming
  • The Official Lost Gaming Club's Undumped Games
  • The Official Lost Gaming Club's Tip Of My Tounge
  • The Official Lost Gaming Club's Lost Gaming Vault
  • The Official Lost Gaming Club's Club Info
  • GIMP Users's Discussion

Blogs

There are no results to display.

There are no results to display.

Calendars

  • AtariAge Calendar
  • The Club of Clubs's Events
  • Atari BBS Gurus's Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website


Facebook


Twitter


Instagram


YouTube


eBay


GitHub


Custom Status


Location


Interests


Currently Playing


Playing Next

Found 3 results

  1. Ok since I've been letting yet another side project rot away for too long and I really don't know if/when I'll get back to it, here's another little demo as I fiddle with scrolling. In a nutshell the program uses plotmapfile to display full screens in 160A and the player can move about in 4 directions, going 1 full tile at a time. When you reach the edge of the screen that is connected to a different map, it will scroll that map in black and white to the new screen then flash the color back. There are only two screens in this program. The screen you start in, and the screen to the left of it. Any other screen edges you can reach are "dead" and won't trigger a change. There's a "template" tmx file included that's got the embedded tiles, etc all set up for adding new screens for playing around with. Additionally this demo includes collision detection between the player and the map tiles. Changing around the order of tiles in the tmx files would obviously mess around with the collision code so keep that in mind. Compiling instructions in a command/dos window are listed in the bank0c.bas file. As mentioned in that file feel free to use anything in the code in your own projects. And yes, I suck at drawing hero sprites. rpg7800.zip rpg.bas.a78 rpg.bas.bin rpg7800-fixed.zip
  2. Hey all. First post, first game, first question. I'd like to make a simple two-player fighting game. I have 2 player sprites controllable on screen, a background, and now I just need to define some things such as the edges of the screen where the players bump into, bumping into eachother, and add a missile-based punch function, and collision between those missiles and the two players. attached is my (likely rough) code, everything working up to the point where I need to add the things described. As far as work flow goes, I've gotten to the point where I need to figure out and add collision detection, and I haven't yet begun exploring the missile system, but help with both would be very valuable to me. So far I've seen lots of complicated examples of collision detection, where the playing field wasn't a solid block that the players appear in front of (like my game), and included X and Y axis movement. I only require X axis movement, so I only require X axis collision detection, and between a total of 4 (or 6, including the edges of the screen) objects. I feel as though I understand what needs to be coded, but I'm not sure how to do it without making things far more complicated than I perceive that they need to be. in psuedo code: if collision(player0, player1) then player0 can't move right and player1 can't move left if collision(player0, left edge of screen) then player0 can't move left if collision(player1, right edge of screen) then player1 can't move right I think I read under random terrain's tutorial stuff that only standard objects like player1, missile0, etc are valid arguments in the collision/!collision statements. how do I work around this? I'd be really stoked to find out that the required work is easy, but if it required defining several constants or dimensions and includes checks and calls in the main loop.. can someone help spell it out for me? I really appreciate any help on this one. Lincoln Fight.bas
  3. I got this to work, and wanted to share as I could find no information searching. RT has added a clearer example to his batari Basic site: http://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#ex_dpc_shooting_nusiz Also there is a powerful "trick" that lets you cover all (or as many) virtual sprites as you want with the same code block. First you check for missile0 Player1 collision. Skip the routine if no collision. Second, find which virtual sprite was hit, set trick value, go to find out which copy, and rearrange. For triple copy, medium, there are 7 routines. For double copy, medium, there are 2 routines. Keeping track of the remaining routines are the variables enemyP2 thru enemyP8. To explain double copy: Player2 starts out with 2 copies, enemyP2 is 2. If you hit the left one, the on-goto will take the far right branch. (the first branch if enemyP2 is 0, the 2nd branch if enemyP2 is 1, the third branch I'd enemyP2 is 2) As the left sprite was hit, change to one copy NUSIZ2=0, move the single sprite over to where the copy was, set enemyP2 to 1. When next Player2 is hit, move it off screen, set enemyP2 to 0. Triple copy has more rearranging. Shooting the left enemy of 3 copies first, change to double copies, medium, move right to where copy 2 was, set enemyP3 to 3 which will next take "which 2 on the right" has been hit. Shooting the center enemy of 3 copies, change to double copies wide. enemyP3=5, that branch being "which 2 of wide" has been hit. Shooting the right enemy of 3 copies, change to double copies, medium. enemyP3=6. "which 2 on the left" So what is left over after a hit on one of 3 copies determines which branch will be taken for the 2 remaining copies to become 1 copy. Now to explain the "trick". Why is everything in the routine enemyP2 and player2 and NUSIZ2? The value in the brackets points to them sequentially. player2[0] is player2 player2[1] is player3 player2[2] is player4 etc. It works for NUSIZ2[0] thru NUSIZ2[6] (and NUSIZ2[7] if you need to set NUSIZ9) and because I set enemyP2 through enemyP8 as variables: a, b, c, d, e, f, g it works there also. Sometimes I have seen some collisions detected, the missile resets, the explosion sound is played, but the player doesn't get removed. I think my +values are correct, but possibly they are not. Maybe every once in a while it just fails a check? dim enemyP2=a dim enemyP3=b dim enemyP4=c dim enemyP5=d dim enemyP6=e dim enemyP7=f dim enemyP8=g ; Note: Above must be sequential for "trick" dim trick=t NUSIZ2=$02: NUSIZ4=$02: NUSIZ6=$02: NUSIZ8=$02: enemyP8=2: enemyP6=2: enemyP4=2: enemyP2=2 NUSIZ3=$06: NUSIZ5=$06: NUSIZ7=$06 enemyP7=7: enemyP5=7: enemyP3=7 DF6FRACINC=255: DF4FRACINC=255: DF0FRACINC=255: DF1FRACINC=255: DF2FRACINC=255: DF3FRACINC=255 ; Backgrnd colors.; PF colors.; Column 0. ; Column 1. ; Column 2. ; Column 3. drawscreen ;******************************************************************************************************************************************** ; ; missile0 collision check. ; ;``````````````````````````````````````````````````````````````` ; Checks for missile0 collision with other 8 sprites, reflected. ; As above, outside game loop, NUSIZx x=2 thru 8 ; Sprites 2, 4, 6, 8 are double, medium. ; Sprites 3, 5, 7 are triple, medium. ; if !collision(missile0,player1) then goto __Skip_m0_Collision if (missile0y+4)>=player2y && missile0y<=(player2y+4) && missile0x >=player2x && missile0x <= (player2x+64) then trick=0: goto whichCopy2 if (missile0y+4)>=player3y && missile0y<=(player3y+4) && missile0x >=player3x && missile0x <= (player3x+72) then trick=1: goto whichCopy1 if (missile0y+4)>=player4y && missile0y<=(player4y+4) && missile0x >=player4x && missile0x <= (player4x+64) then trick=2: goto whichCopy2 if (missile0y+4)>=player5y && missile0y<=(player5y+4) && missile0x >=player5x && missile0x <= (player5x+72) then trick=3: goto whichCopy1 if (missile0y+4)>=player6y && missile0y<=(player6y+4) && missile0x >=player6x && missile0x <= (player6x+64) then trick=4: goto whichCopy2 if (missile0y+4)>=player7y && missile0y<=(player7y+4) && missile0x >=player7x && missile0x <= (player7x+72) then trick=5: goto whichCopy1 if (missile0y+4)>=player8y && missile0y<=(player8y+4) && missile0x >=player8x && missile0x <= (player8x+64) then trick=6: goto whichCopy2 goto __Skip_m0_Collision whichCopy1 temp2=enemyP2[trick] on temp2 goto __Skip_m0_Collision which7w1 which7w1 which7w2l which7w1 which7w2w which7w2l which7w3 which7w3 if missile0x <= player2x[trick]+8 then NUSIZ2[trick]=$02: player2x[trick]=player2x[trick]+32: enemyP2[trick]=3: goto resetMissile0 if missile0x >= player2x[trick]+32 && missile0x <= player2x[trick]+40 then NUSIZ2[trick]=$04: enemyP2[trick]=5: goto resetMissile0 if missile0x >= player2x[trick]+64 && missile0x <= player2x[trick]+72 then NUSIZ2[trick]=$02: enemyP2[trick]=3: goto resetMissile0 which7w1 if missile0x <= player2x[trick]+8 then player2y[trick]=200: enemyP2[trick]=0: goto resetMissile0 which7w2w if missile0x <= player2x[trick]+8 then player2x[trick]=player2x[trick]+64: goto whichCopyEnd if missile0x >= player2x[trick]+64 && missile0x <= player2x[trick]+72 then whichCopyEnd which7w2l if missile0x <= player2x[trick]+8 then player2x[trick]=player2x[trick]+32: goto whichCopyEnd if missile0x >= player2x[trick]+32 && missile0x <= player2x[trick]+40 then whichCopyEnd whichCopyEnd NUSIZ2[trick]=$00: enemyP2[trick]=1: goto resetMissile0 whichCopy2 temp1=enemyP2[trick] on temp1 goto resetMissile0 which7w1 which7w2l dim enemyP2=a dim enemyP3=b dim enemyP4=c dim enemyP5=d dim enemyP6=e dim enemyP7=f dim enemyP8=g ; Note: Above must be sequential for "trick" dim trick=t NUSIZ2=$02: NUSIZ4=$02: NUSIZ6=$02: NUSIZ8=$02: enemyP8=2: enemyP6=2: enemyP4=2: enemyP2=2 NUSIZ3=$06: NUSIZ5=$06: NUSIZ7=$06 enemyP7=7: enemyP5=7: enemyP3=7 DF6FRACINC=255: DF4FRACINC=255: DF0FRACINC=255: DF1FRACINC=255: DF2FRACINC=255: DF3FRACINC=255 ; Backgrnd colors.; PF colors.; Column 0. ; Column 1. ; Column 2. ; Column 3. drawscreen ;******************************************************************************************************************************************** ; ; missile0 collision check. ; ;``````````````````````````````````````````````````````````````` ; Checks for missile0 collision with other 8 sprites, reflected. ; As above, outside game loop, NUSIZx x=2 thru 8 ; Sprites 2, 4, 6, 8 are double, medium. ; Sprites 3, 5, 7 are triple, medium. ; if !collision(missile0,player1) then goto __Skip_m0_Collision if (missile0y+4)>=player2y && missile0y<=(player2y+4) && missile0x >=player2x && missile0x <= (player2x+64) then trick=0: goto whichCopy2 if (missile0y+4)>=player3y && missile0y<=(player3y+4) && missile0x >=player3x && missile0x <= (player3x+72) then trick=1: goto whichCopy1 if (missile0y+4)>=player4y && missile0y<=(player4y+4) && missile0x >=player4x && missile0x <= (player4x+64) then trick=2: goto whichCopy2 if (missile0y+4)>=player5y && missile0y<=(player5y+4) && missile0x >=player5x && missile0x <= (player5x+72) then trick=3: goto whichCopy1 if (missile0y+4)>=player6y && missile0y<=(player6y+4) && missile0x >=player6x && missile0x <= (player6x+64) then trick=4: goto whichCopy2 if (missile0y+4)>=player7y && missile0y<=(player7y+4) && missile0x >=player7x && missile0x <= (player7x+72) then trick=5: goto whichCopy1 if (missile0y+4)>=player8y && missile0y<=(player8y+4) && missile0x >=player8x && missile0x <= (player8x+64) then trick=6: goto whichCopy2 goto __Skip_m0_Collision whichCopy1 temp2=enemyP2[trick] on temp2 goto __Skip_m0_Collision which7w1 which7w1 which7w2r which7w1 which7w2w which7w2l which7w3 which7w3 if missile0x <= player2x[trick]+8 then NUSIZ2[trick]=$02: player2x[trick]=player2x[trick]+32: enemyP2[trick]=3 if missile0x >= player2x[trick]+32 && missile0x <= player2x[trick]+40 then NUSIZ2[trick]=$04: enemyP2[trick]=5 if missile0x >= player2x[trick]+64 && missile0x <= player2x[trick]+72 then NUSIZ2[trick]=$02: enemyP2[trick]=6 goto resetMissile0 which7w2r if missile0x <= player2x[trick]+8 then NUSIZ2[trick]=$00: player2x[trick]=player2x[trick]+32: enemyP2[trick]=1 if missile0x >= player2x[trick]+32 && missile0x <= player2x[trick]+40 then NUSIZ2[trick]=$00: enemyP2[trick]=2 goto resetMissile0 which7w1 if missile0x <= player2x[trick]+8 then player2y[trick]=200: enemyP2[trick]=0 goto resetMissile0 which7w2w if missile0x <= player2x[trick]+8 then NUSIZ2[trick]=$00: player2x[trick]=player2x[trick]+64: enemyP2[trick]=1 if missile0x >= player2x[trick]+64 && missile0x <= player2x[trick]+72 then NUSIZ2[trick]=$00: enemyP2[trick]=4 goto resetMissile0 which7w2l if missile0x <= player2x[trick]+8 then NUSIZ2[trick]=$00: player2x[trick]=player2x[trick]+32: enemyP2[trick]=2 if missile0x >= player2x[trick]+32 && missile0x <= player2x[trick]+40 then NUSIZ2[trick]=$00: enemyP2[trick]=4 goto resetMissile0 whichCopy2 temp1=enemyP2[trick] on temp1 goto resetMissile0 which2w1 which2w2 which2w2 if missile0x <= player2x[trick]+8 then player2x[trick]=player2x[trick]+32: enemyP2[trick]=1: NUSIZ2[trick]=$00: goto resetMissile0 if missile0x >= player2x[trick]+32 && missile0x <= player2x[trick]+40 then enemyP2[trick]=1: NUSIZ2[trick]=$00 goto resetMissile0 which2w1 if missile0x < player2x[trick]+8 then player2y[trick]=200: enemyP2[trick]=0 goto resetMissile0
×
×
  • Create New...