This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Spongy141's profile picture

Game that I made in 10-20 minutes.

Started by Spongy141, 15 April 2013 - 03:30 PM
Spongy141 #1
Posted 15 April 2013 - 05:30 PM
Well today I was joking with my cousin, so I made a game in regular Lua to mess with him, but decided to actually work on it as a real thing. Well please tell me what you think of it, and please try to stay positive, if you find any bugs… I wrote 99% of it on my iPhone… no screen shots will be added soon, since I at the moment I have a lot of stuff I need to do, and I don't have time..
Anyways link
So far you fight a random enemy, only one enemy, you get to customize your player, its buggy, and sometimes (from testing it) you randomly die… I'm currently trying to fix that, now it WILL NOT work in Computer Craft, so don't try, you'll need to
go to lua.org to install there software to use Lua files correctly, OR if you want to play this on your iPod/iPhone (I don't know if they have a app for Androids) called Touch Lua, its free, or get an other, your chose, then copy and paste the code from the pastebin link into the file of your chose, on Touch Lua (Hopefully you chose this app) create a new file, then just paste the code into there, there is no "save" option, it auto saves for you. Then run the file. It should work.
SCREEN SHOTS WILL BE ADDED LATER, also I will make the topic look better.
EDIT: I'm currently converting the game into C++ from Lua…. may take a while. For me….
Spongy141 #2
Posted 15 April 2013 - 07:38 PM
EDIT: For best game experience play it on Touch Lua, I've testes it on a couple different apps, and found it works best on Touch Lua.
superaxander #3
Posted 15 April 2013 - 07:56 PM
Erm player is not defined and on line 77 it needs to be

if attack ~= "Y" and attack == "N" then
Spongy141 #4
Posted 15 April 2013 - 08:09 PM
Alright thanks, also I will release the next update tomorrow I already added like 40 new lines to the game…
Smiley43210 #5
Posted 15 April 2013 - 09:50 PM
No isn't line 77 supposed to be
if attack ~= "Y" and attack ~= "N" then
because it says
print("*Face Palm* its Y or N not "..attack)
meaning that the user entered neither Y nor N.
superaxander #6
Posted 15 April 2013 - 10:04 PM
I just realized
Oh and at

player = {}
enemy = {}
Nenemy = {}
At the beginning
Smiley43210 #7
Posted 15 April 2013 - 11:34 PM
So…wait…you're not supposed to be able to win if you have 3 damage and 4 armor, right?
1lann #8
Posted 16 April 2013 - 12:33 AM
Fyi, you didn't compile the file so it is open source…

Also, you can make this work on CC and normal Lua by changing all of the io.read("*n") to tonumber(io.read())
SadKingBilly #9
Posted 16 April 2013 - 02:08 AM
Fyi, you didn't compile the file so it is open source…
To be fair, there's a difference between open source and visible source. Minecraft, for instance, is closed source. You can deobfuscate it and view the source code, but you aren't legally allowed to redistribute it. Therefore, while you can—more or less—view the source code, it's still very much a closed source game. Though I'm not entirely sure why you even mentioned it.
Spongy141 #10
Posted 16 April 2013 - 03:11 AM
I've updated the link, the game has a little more to it now, like your armor can now break. Still having the problem with randomly getting killed… if anyone finds were the error for that is it would be great appreciated.
EDIT: And I will clean up how the topic is organized later… I know it looks ugly.


So…wait…you're not supposed to be able to win if you have 3 damage and 4 armor, right?
Kinda, at first I was going to make the enemy armor be the players armor + 0.5, but I had problems with that… and I had problems with both user and enemy health being added not subtracted when having lots of armor. So you needed to have your armor low with damage high, but I took that out before I released the new update.
remiX #11
Posted 16 April 2013 - 06:49 AM
Looks nice :)/>

Btw, it's lose, not loose :P/>
Spongy141 #12
Posted 16 April 2013 - 11:10 AM
Lol, well I'll go fix that now. Oh and I'm trying to fix a lot of the known bugs atm, so the next release SHOULD have the a lot of the bugs fixed.
1lann #13
Posted 17 April 2013 - 12:47 AM
Fyi, you didn't compile the file so it is open source…
To be fair, there's a difference between open source and visible source. Minecraft, for instance, is closed source. You can deobfuscate it and view the source code, but you aren't legally allowed to redistribute it. Therefore, while you can—more or less—view the source code, it's still very much a closed source game. Though I'm not entirely sure why you even mentioned it.
Well I haven't ever seen reallyy anyone use the term "visible source" so I just count open source as code that is visible, not obfuscated nor compiled. Well I mentioned it because, since I assumed open source meant source that is not obfuscated nor compiled, I just wanted to say that I thought that it wasn't open source… Like other people pointing mistakes. But yeah officialy open source means free to use, modifiable and re-distributable.
Spongy141 #14
Posted 17 April 2013 - 11:54 AM
^
Well is free, just I don't want people modifying my code without my permission.
Sammich Lord #15
Posted 17 April 2013 - 11:57 AM
Fyi, you didn't compile the file so it is open source…
To be fair, there's a difference between open source and visible source. Minecraft, for instance, is closed source. You can deobfuscate it and view the source code, but you aren't legally allowed to redistribute it. Therefore, while you can—more or less—view the source code, it's still very much a closed source game. Though I'm not entirely sure why you even mentioned it.
Well I haven't ever seen reallyy anyone use the term "visible source" so I just count open source as code that is visible, not obfuscated nor compiled. Well I mentioned it because, since I assumed open source meant source that is not obfuscated nor compiled, I just wanted to say that I thought that it wasn't open source… Like other people pointing mistakes. But yeah officialy open source means free to use, modifiable and re-distributable.
Open source does not mean you can re-distributable, free nor modifiable. It simply means you can see the source. If I released something where you can see the source but you have to pay $50 to use it and you cannot do anything except run it then it would still be open-source.
Engineer #16
Posted 18 April 2013 - 04:12 AM
Dont quote me on this, but according to wikipedia:
Open-source software is software whose source code is published and made available to the public, enabling anyone to copy, modify and redistribute the source code without paying royalties or fees. Open-source code can evolve through community cooperation. These communities are composed of individual programmers as well as very large companies. Many of these individuals programmers who start an open-source project usually end up as large companies with open-source programs.

On-topic: Learn to indent properly please.. It makes reading the code much more easy
Spongy141 #17
Posted 18 April 2013 - 01:05 PM
^
indent properly? First off, everyone indents differently so there's no "proper" way, second if there was a proper way it would be double spacing for any function and multi-line stuff (Like ifs, for, while this do, ect.) Which the majority does double space as a indention, so please refrain from trying to insult someone if you don't have the correct facts.
Plus (if you took the time to even read what I said) I wrote this code on my iPhone, so I did my best to indent, you try typing on a small ass screen and make everything perfect, if you can (with code over 100 lines) then reply, if you can't, don't even bother to read ANY topics I post, since I unwelcome you to read them.
oeed #18
Posted 18 April 2013 - 01:14 PM
At this rate someone is going to tell us the made a game in 30 seconds.


(http://www.computercraft.info/forums2/index.php?/topic/11931-i-made-a-game-this-week/)
Spongy141 #19
Posted 18 April 2013 - 01:20 PM
^
Challenged accepted!


while true do
  print("DO something! (attack/run)")
  local r = io.read()
  if r == "attack" then
    print("Nice you killed him! New mob will spawn!")
  end
  if r == "run" then
    print("You died!")
return
  end
end
:(/> it took me about 1 min and 30 seconds, I failed. :(/> :(/> :(/>
MudkipTheEpic #20
Posted 18 April 2013 - 01:21 PM
Chalenge accepted:

print("Click to Win")
os.pullEventRaw("mouse_click")
print("YAY U WIN")

10 seconds. XD
Spongy141 #21
Posted 18 April 2013 - 01:23 PM
^
Lol, I did mine in regular lua, wait can you even detect a mouse click in regular lua?
MudkipTheEpic #22
Posted 18 April 2013 - 01:24 PM
Ok, then new one.

print("BE PATIENT TO WIN!")
sleep(math.huge)
print("U WIN")

> 7 seconds.
Spongy141 #23
Posted 18 April 2013 - 02:33 PM
print("YOU WIN")

About 2 seconds :P/>
Sammich Lord #24
Posted 18 April 2013 - 02:36 PM
I would post one line of code and say 1 second but if it continues like this it will probably get locked.
Spongy141 #25
Posted 18 April 2013 - 06:12 PM
^
True
*Goes to forums games*
Well guess I'm going to see how this goes.
Engineer #26
Posted 18 April 2013 - 07:42 PM
^
indent properly? First off, everyone indents differently so there's no "proper" way, second if there was a proper way it would be double spacing for any function and multi-line stuff (Like ifs, for, while this do, ect.) Which the majority does double space as a indention, so please refrain from trying to insult someone if you don't have the correct facts.
Plus (if you took the time to even read what I said) I wrote this code on my iPhone, so I did my best to indent, you try typing on a small ass screen and make everything perfect, if you can (with code over 100 lines) then reply, if you can't, don't even bother to read ANY topics I post, since I unwelcome you to read them.

Of course there is a right way. I mean, there is a huge difference between;

if something then 
        Print('something')
               end

and


if something then
     print('something')
end

Or tell me whats more readable:

if something then
   for i = 1, 4 do
        while true do
             --something
end 
end
end

or

 
if something then
   for i = 1, 4 do
       while true do
          --something
       end
   end
end
Spongy141 #27
Posted 19 April 2013 - 03:09 AM
^
That would be an error with pastebin, since it looks perfectly fine on both my iPhone and in notepad++, I was trying to fix that, but it would just go back to that way after I tried…
Spongy141 #28
Posted 21 April 2013 - 07:20 PM
Well I decided that instead of converting the game into CC-Lua, to convert it into C++, along the line I will also convert it into CC-Lua.
AfterLifeLochie #29
Posted 21 April 2013 - 10:03 PM
Moved to the Media board.