PONG!
The classic game for the Atari, horribly remade!
Description:
This cartridge is a poorly done remake of the game "Pong" for the Atari!
Although it's different because the original Atari Pong didn't have an exclamation
mark in it's name, here's a visualization for that:
Pong (1972) <- Not cool, does not have an exclamation mark after it's name
Pong! (2023) <- Very cool, has exclamation mark after it's name
Anyways, this game uses my color collision system, which means that it doesn't have very smooth collision, although trust me it's playable, there's just gonna be some bugs that I haven't figured out yet. It also means that this isn't pure black and white, which would have been preferable. Luckily, I may update this soon and fix bugs, revamp the collision, and add anything else that would enhance the experience of-
PONG!
^
||
Now THATS one hell of an exclamation mark!
Controls:
Game:
Player 1:
- Up: Up
- Down: Down
Player 2:
- Up: X
- Down: O
This system is not my own original work
Tis a tweak of a tutorial's system
Following a tutorial by/on NerdyTeachers.com, I was able to whip up this simple collision demo with flag collision, camera collision, movement, and a terrible "music" track.
The tutorial link(s) are below for anyone interested!
https://nerdyteachers.com/Explain/Platformer/
Collision system:
function colcheck(plr,flag,aim) -- player is a table -- player must have x,y in it's table -- flag must be an integer, in our case "0" symbolizes a solid wall -- aim: 0=left,1=right,2=up,3=down -- I don't need width or height in my player table because I know (in my case) it will always be 8 on both sides if pl.iscol==false then -- if the player can't collide, then return "false" return false -- In our case, true = yes, there is something blocking you from moving in that direction -- whereas false = no, there is nothing in that direction end local x=plr.x local y=plr.y -- Make referring to the current x/y simple local x1=0 local x2=0 -- Declare our x1/x2/y1/y2 variables for further modification local y1=0 local y2=0 if aim == 0 then -- What we do here is create a 1 pixel wide and imaginary rectangle using 2 coordinates so we can -- check for collisions, we then use our already defined 2 coords. to find the other coordinates -- in the rectangle to form it completely. This is pretty complicated to be explained in text, -- so I recommend you watch, read the tutorial for a visual explanation! x1=x x2=x-1 y1=y y2=y+7 elseif aim == 1 then x1=x+7 x2=x+8 y1=y y2=y+7 elseif aim == 2 then x1=x x2=x+7 y1=y y2=y-1 elseif aim == 3 then x1=x x2=x+7 y1=y+7 y2=y+8 end x1/=8 x2/=8 y1/=8 y2/=8 -- Divide our imaginary box coordinates by 8, for tile conversion if fget(mget(x1,y1),flag) -- Check if any of our coordinates have a sprite on the same tile coord. or fget(mget(x2,y2),flag) -- "Or" for simplicity, if ANY of our values are colliding we return true or fget(mget(x2,y1),flag) or fget(mget(x1,y2),flag) then return true -- Yep, we found a collision else -- If we haven't found a collision, then return false -- Nope, you are good to move further end -- End our check end -- End the function |