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

Moneybags - Alpha 1.5 PR, Added save files 'n junk!

Started by brett122798, 25 May 2013 - 02:24 AM
brett122798 #1
Posted 25 May 2013 - 04:24 AM
Hi everyone, haven't been programming in Lua lately, due to not having much time, but I'm back to it! So I've made a game that is based off my friend, Casey, in real life he gets $300 in allowance so it is called Moneybags. The basic objective of the game is just to try not to get hit with a moneybag.. Now note, this game is in the Alpha stage, and barely has much to it.


Pictures:
SpoilerOldish..







Downloads:

Moneybags Alpha 1.5 Pre-Release: Pastebin | Download File | Command: pastebin get qz04uTek moneybags

Moneybags Alpha 1.4.1: Pastebin | Download File | Command: pastebin get yQAcW3W9 moneybags

Moneybags Alpha 1.4: Pastebin | Download File | Command: pastebin get mm5JqehV moneybags
Moneybags Alpha 1.3: Pastebin | Download File
Moneybags Alpha 1.2.2: Pastebin | Download File
Moneybags Alpha 1.2.1: Pastebin | Download File


Controls:

W / Up Arrow Key = Up

S / Down Arrow Key = Down

Enter = Select / Pause Game


Objective:

You dodge the moneybags that Casey is throwing at you. That's pretty much it.


Changelog:
SpoilerAlpha 1.5 Pre-Release:
- Added Userdata (Username and Modem Side, will have a use in Beta)
- Added save files, you can save your files in the pause menu and load them when starting Single Player
- Location of the Moneybags files can be found at: ProgramData/Moneybags
- Added crash screen for prettier debugging
- Shortened a piece of code
* This update lacks full features like "Go Back" in some menus and the Options menu. It may also contain bugs. Everything will be all fixed up in the official release of 1.5.

Alpha 1.4.1:
- Shortened code by A LOT!
* No Features added in this update.

Alpha 1.4:
- Made game even more challenging by cutting the tick speed in half
- Due to the game being more challenging, you get +1 Life every 500 points
- Added Pause Menu! You don't have to continuously play like how you do on a Pac-Man machine any longer!
- Indented code that wasn't indented properly in some places

Alpha 1.3:
- Made games harder, there's now double moneybags on the screen

Alpha 1.2.2:
- Change lose screen countdown to a key press to exit it.

Alpha 1.2.1:
- Initial Public Release



Planned Features(In Order of Priority):

- Make game harder Done!
- Casey has money and gets $300 every so often Semi-Done.. the money doesn't do anything yet..
- Add pause menu Done!
- Shorten code with some table reorganizing and loops Done!
- Highscores
- Multiplayer
- iPad Minis, iPhones, and 3DSs for Casey to throw
- Color Support


Any comments, constructive criticism on my code, or ideas? Please reply! :)/>
H4X0RZ #2
Posted 25 May 2013 - 05:04 AM
What do you have to do in this game?
brett122798 #3
Posted 25 May 2013 - 05:07 AM
What do you have to do in this game?
Dodge the moneybags.
svdragster #4
Posted 25 May 2013 - 05:08 AM
Epic!
But instead of the "Continuing in loseCount seconds" you could make "Press any key" with os.pullEvent(). I hate waiting when I lost ^^
brett122798 #5
Posted 25 May 2013 - 05:12 AM
Epic!
But instead of the "Continuing in loseCount seconds" you could make "Press any key" with os.pullEvent(). I hate waiting when I lost ^^
Yeah, I plan on revising that in the next update, I just whipped up that lose system pretty quick at the time.

EDIT: Updated, just for that. :P/>
brett122798 #6
Posted 26 May 2013 - 04:01 AM
New update! Made games harder!
iamsparta1234 #7
Posted 04 June 2013 - 07:16 PM
OMG!
My score was 2500!
I had only 2 lives!
And it was just my second try on the game!!! :D/>
ArchAngel075 #8
Posted 04 June 2013 - 08:10 PM
Very good game, extremely smooth and responsive keys!. I only squirmed when I tried going far up and realized the topmost "lane" is taken by the score display.
Perhaps a small visual indicator to show boundaries?
brett122798 #9
Posted 04 June 2013 - 08:51 PM
Very good game, extremely smooth and responsive keys!. I only squirmed when I tried going far up and realized the topmost "lane" is taken by the score display.
Perhaps a small visual indicator to show boundaries?
In the next update, I'm adding the amount of Money at the top, so the whole top row will be filled. I also plan to add text to the bottom row.

And also, to everyone, the next update will include a pause menu!! :D/>
brett122798 #10
Posted 05 June 2013 - 01:29 AM
Updated to Alpha 1.4! Pretty large update, in my opinion.
Tjakka5 #11
Posted 05 June 2013 - 12:41 PM
I just tried it and I liked it, got around 700 points, however…
I looked in the code, and saw that the most lines were used on moneybagone this, moneybagtwo that.

Couldnt you use a table to do a for loop like this:


for i = 1, 16 do
  if moneyBagOnScreen[i] =- true then
    term.setCursorPos(moneyBagXpos[i], moneyBagYpos[i] +1)
    print(">$")
  end
end
	

I wouldnt know how well that would work, but it's just a little suggestion…
brett122798 #12
Posted 05 June 2013 - 06:53 PM
I just tried it and I liked it, got around 700 points, however…
I looked in the code, and saw that the most lines were used on moneybagone this, moneybagtwo that.

Couldnt you use a table to do a for loop like this:


for i = 1, 16 do
  if moneyBagOnScreen[i] =- true then
	term.setCursorPos(moneyBagXpos[i], moneyBagYpos[i] +1)
	print(">$")
  end
end
	

I wouldnt know how well that would work, but it's just a little suggestion…
That would not work due to how I defined the tables. However, I may rename them just for the sake of shortening the code. Thanks. :)/>
nutcase84 #13
Posted 05 June 2013 - 07:07 PM
Epic creation! Good time-passer.
brett122798 #14
Posted 06 June 2013 - 12:26 AM
Updated to Alpha 1.4.1! Code is insanely shorter and efficient now!

Epic creation! Good time-passer.
Thanks! :D/>
Symmetryc #15
Posted 06 June 2013 - 08:56 AM
I haven't played it yet, but I've noticed something you could shorten in your code :)/> :

moneybag = {}
for i=1, 16 do
  moneybag[i] = {onScreen = false, xPos = 0}
end
brett122798 #16
Posted 06 June 2013 - 10:37 AM
I haven't played it yet, but I've noticed something you could shorten in your code :)/> :

moneybag = {}
for i=1, 16 do
  moneybag[i] = {onScreen = false, xPos = 0}
end
Huh, didn't even think about that! Thanks! :D/>
brett122798 #17
Posted 09 June 2013 - 12:21 AM
Updated to Alpha 1.5 Pre-Release!