0ÿÿÿÿÿÿÿ§ðp8·d%qy)6o;]ÉA¦ösï÷ôôô”°ÂVl†3 134 then --134-24=110 pad.Y = 134-Paddle_Height end end end function Updates_Start() if Active_Player == 1 then Ball.Y = Paddles.P1.Y+(Paddle_Height/2)-(Ball_Size/2) Ball.DY = Paddles.P1.Last_Move else Ball.Y = Paddles.P2.Y+(Paddle_Height/2)-(Ball_Size/2) Ball.DY = Paddles.P2.Last_Move end end function Updates_Game() Ball.X = Ball.X+(Ball.DX*Game_Speed) Ball.Y = Ball.Y+(Ball.DY*Game_Speed) if (Ball.Y < 2) or (Ball.Y+Ball_Size > 134) then Ball.DY = 0 - Ball.DY sfx(0) end for i,pad in pairs(Paddles) do local pad_Collide = Check_Ball_Collision(pad) if pad_Collide and not pad.Prev_Collide then pad_Hit(pad) end pad.Prev_Collide = pad_Collide end --THIS FUCKING END STATEMENT CAUSED ME SO MUCH PAIN OH MY GOD HOW DID I NOT SEE IT'S MISSING if Ball.X > 240 then P1_Score = P1_Score+1 sfx(3) Active_Player = 1 RESET() elseif Ball.X+Ball_Size < 0 then P2_Score = P2_Score+1 sfx(3) Active_Player = 2 RESET() end end function Draw_Game() cls(0) line(0,0,240,0,2) line(0,135,240,135,2) for i,pad in pairs(Paddles) do rect(pad.X,pad.Y,2,Paddle_Height,1) -- Paddles end rect(119,0,2,136,2) rect(Ball.X,Ball.Y,Ball_Size,Ball_Size,1) end function Draw_Start() local Arrow_Flip = 0 if Ball.DY > 0 then Arrow_Flip = 2 end if Active_Player == 1 then Print_Center("WELCOME TO PONG - PLAYER 1 SERVING",116,1) spr(257,Ball.X-2,Ball.Y-2,0,1,Arrow_Flip) else Print_Center("WELCOME TO PONG - PLAYER 2 SERVING",116,1) spr(257,Ball.X-2,Ball.Y-2,0,1,Arrow_Flip+1) end Print_Center("PRESS LEFT/B TO START",128,1) Print_Center(P1_Score,8,2,-64) Print_Center(P2_Score,8,2,64) if Key_Board then spr(288,30,96,0,1,0,0,2,2) spr(290,240-30-16,96,0,1,0,0,2,2) else spr(258,30,96,0,1,0,0,2,2) spr(260,240-30-16,96,0,1,0,0,2,2) end end function Draw_Menu() cls(0) Print_Center("PING",32,4) Print_Center(":Select Input:",64) Print_Center("Key-Board Controls",80) Print_Center("Party Mode / Shared Controller",96) rectb(240/2-182/2,78+(Menu_Item*16),183,10,4) end function MENU(ID) if ID == 0 then Key_Board = true elseif ID == 1 then Key_Board = false end end function Check_Ball_Collision(pad) if (Ball.X < pad.X+2) and (Ball.X+Ball_Size > pad.X) and (Ball.Y < pad.Y+Paddle_Height) and (Ball.Y+Ball_Size > pad.Y) then return true end return false end function pad_Hit(pad) Ball.DX = 0-Ball.DX if pad.Is_Moving then -- () Ball.DY = Clamp(Ball.DY+(pad.Last_Move*0.5),-2,2) end sfx(1) if Game_Speed < 4 then Game_Speed = Game_Speed+0.1 end end function Clamp(Val,Min_Val,Max_Val) local Lower = math.min(Val,Max_Val) return math.max(Lower,Min_Val) end function Print_Center(Text,Y_Pos,Scale,X_OffSet) if Scale == nil then Scale = 1 end if X_OffSet == nil then X_OffSet = 0 end local Length = print(Text,0,-300,3,true,Scale) print(Text,121-(Length/2)+X_OffSet,Y_Pos,3,true,Scale) end