Hey, I had this awesome idea, in my opinion ComputerCraft hasn't got enough games! So, what will we do? Add our own!
So the idea is everyone who has made a game or is making one will post them here, thereby creating a neat list of games for us to play inside minecraft with or against others for example on a server or alone in ssp.
The layout:
[size=6]Title[/size]
Amount of players:
Genre:
Screenshots
[spoiler]
Image1 + description
Image2 + description[/spoiler]
Code
[spoiler][code]--Paste your code here[/code*][/spoiler]
Author:
Credits(optional):
Note, remove the * from [/code*]
How to find/install the games
Singleplayer
For windows users, go to %appdata% then click on: Roaming>.minecraft>Saves>'WorldName'>computer>'ComputerID'
If you don't know the ID of your computer, in the computer type id and it will return it's ID.
In there you can open the existing game with for example notepad (or Notepad++) and copy it to here.
If you want to install a game, create a new text file, paste the code and save it as All types (*.*), make sure you have no .txt at the end!
Multiplayer
If you are the host of the server, go to the 'ServerFolder'>'WorldName'>computer>'ComputerID'
Again, to find the ID of the computer, in the computer type id and it will return it's ID, there you'll be able to find the game.
And installing a game is the same as for singleplayer, paste the code in a new text file and save it as All types (*.*)
If you aren't the host of the server ask the host to check out this page and let him/her install the desired game(s).
List of all games so far
- Pong Download: Pong
- Tunnel Download: Tunnel
- Your awesome game?
-
I will start with my own recently made game, PONG!
PONG!
Amount of players: 2
Genre: Arcade
Screenshots
Spoiler
This is the startscreen, showing the controls before pressing enter to continue to the game itself.Here you can see the game itself.
Code
Spoiler
--Vars
width, height = term.getSize()
i = 0
i_max = width*height
x = 1
y = 1
p1 = 0
p2 = 0
pad1 = math.ceil(height/2)
pad2 = math.ceil(height/2)
up = false
right = true
--Functions
function drawPads()
term.setCursorPos(1,pad1-1)
write("#")
term.setCursorPos(1,pad1)
write("#")
term.setCursorPos(1,pad1+1)
write("#")
term.setCursorPos(1,pad1-2)
write(" ")
term.setCursorPos(1,pad1+2)
write(" ")
if pad1 == 4 then
term.setCursorPos(1,pad1-2)
write("-")
end
if pad1 == 15 then
term.setCursorPos(1,pad1+2)
write("-")
end
term.setCursorPos(width-1,pad2-1)
write("#")
term.setCursorPos(width-1,pad2)
write("#")
term.setCursorPos(width-1,pad2+1)
write("#")
term.setCursorPos(width-1,pad2-2)
write(" ")
term.setCursorPos(width-1,pad2+2)
write(" ")
if pad2 == 4 then
term.setCursorPos(width-1,pad2-2)
write("-")
end
if pad2 == 15 then
term.setCursorPos(width-1,pad2+2)
write("-")
end
end
function ball()
term.setCursorPos(x,y)
write(" ")
if up == true then
y = y - 1
else
y = y + 1
end
if right == true then
if (x == width - 2) then
if y == pad2 or y == pad2-1 or y == pad2+1 then
x = x - 1
right = false
elseif up == true and y == pad2-2 then
x = x - 1
right = false
elseif up == false and y == pad2+2 then
x = x - 1
right = false
else
x = x + 1
end
else
x = x + 1
end
else
if (x == 2) then
if y == pad1 or y == pad1-1 or y == pad1+1 then
x = x + 1
right = true
elseif up == true and y == pad1-2 then
x = x + 1
right = true
elseif up == false and y == pad1+2 then
x = x + 1
right = true
else
x = x - 1
end
else
x = x - 1
end
end
if x == 1 then
right = true
p2 = p2 + 1
x = math.ceil(width/2)
y = math.ceil(height/2)
term.setCursorPos(math.ceil(width/2)-3,1)
write(p1.." | "..p2)
end
if x == (width - 1) then
right = false
p1 = p1 + 1
x = math.ceil(width/2)
y = math.ceil(height/2)
term.setCursorPos(math.ceil(width/2)-3,1)
write(p1.." | "..p2)
end
if y == 3 then up = false end
if y == height-2 then up = true end
end
--Intro
term.clear()
term.setCursorPos(1,1)
print("")
print("")
print(" X==---------------------------------==X")
print(" |ComputerCraft Pong, made by Chub1337!|")
print(" X==---------------------------------==X")
print("")
print("")
print("")
print(" Player 1 controls: W = up, S = down")
print("")
print(" Player 2 controls: O = up, L = down")
print("")
print("")
print("")
print("")
print("")
print("")
write("Press <Enter> to continue.")
io.read()
term.clear()
term.setCursorPos(1,1)
write("Player 1")
term.setCursorPos(width-8,1)
write("Player 2")
term.setCursorPos(math.ceil(width/2)-3,1)
write(p1.." | "..p2)
drawPads()
term.setCursorPos(1,height)
write(pad1.."|"..pad2)
for i=1,width-1,1 do
term.setCursorPos(i,2)
write("-")
end
term.setCursorPos(1,height-1)
for i=1,width-1,1 do
term.setCursorPos(i,height-1)
write("-")
end
--Pong
x = math.ceil(width/2)
y = math.ceil(height/2)
dir = math.ceil(math.random(0,4))
if dir == 1 then
up = true
right = true
elseif dir == 2 then
up = true
right = false
elseif dir == 3 then
up = false
right = true
elseif dir == 4 then
up = false
right = false
end
function timerupdate()
ball()
term.setCursorPos(7,height)
write("X:"..x.." ")
term.setCursorPos(13,height)
write("Y:"..y.." ")
term.setCursorPos(18,height)
write("up:"..tostring(up).." ")
term.setCursorPos(30,height)
write("right:"..tostring(right).." ")
term.setCursorPos(x,y)
write("O")
term.setCursorPos(1,height)
write(pad1.."|"..pad2.." ")
timer1 = os.startTimer(.1)
end
timer1 = os.startTimer(.1)
while true do
event, par = os.pullEvent()
if event == "timer" and par == timer1 then timerupdate() end
if event == "char" then
if par == "w" then
pad1 = pad1 - 1
if pad1 < 4 then
pad1 = 4
end
elseif par == "s" then
pad1 = pad1 + 1
if pad1 > height-3 then
pad1 = height-3
end
end
if par == "o" then
pad2 = pad2 - 1
if pad2 < 4 then
pad2 = 4
end
elseif par == "l" then
pad2 = pad2 + 1
if pad2 > height-3 then
pad2 = height-3
end
end
end
drawPads()
end
Author: Chub1337
Credits: Casper7526 and Cloudy for helping me with handling multiple inputs at the same time.
I hope you guys will flood this topic with your awesome games!
MTFBWY,
-Chub1337