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

Picture Poker

Started by DesertEagle-2000, 19 May 2016 - 05:29 PM
DesertEagle-2000 #1
Posted 19 May 2016 - 07:29 PM
NEW VERSION!: Version 1.2!

Finally, after a long time of nothing. With some major changes, and an installer.
(There are multiple functions from multiple api's in this installer. Check the code for credit's)

Hope you like this update!

*Please note that this is a new version of the game and that it can
be a bit buggy. If you see any bugs, tell me.

Screenshots:
Spoiler



Installer:
Spoiler
pastebin run 2gdn2FPQ

Changelog:
SpoilerV 1.2:
  • Switched from download to installer (There are multiple functions from multiple api's in this installer. Check the code for credit's)
  • Switched from GameUtils to BLittle
  • Added more detail in the game
  • Added a bit more sounds
  • Added a cheat code(???) <–Little hint: It's a world famous code ;)/>
  • Redesigned all cards
  • Fixed click position for bet/draw button
V 1.1:
  • Changed Rules to Help
  • Added more information in Help
  • Added sounds (see Help on how to install)
  • Fixed bug in which you had to click quit multiple times
  • Fixed Java Array Out Of Bounds Error???
V 1.0:
  • First game release
Edited on 09 November 2016 - 01:23 PM
Creator #2
Posted 19 May 2016 - 10:18 PM
I would suggest two things:

1. Pastebin

2. Pics

Aaaand, welcome to the forums! And congrats for posting your first program.
DesertEagle-2000 #3
Posted 19 May 2016 - 10:54 PM
1. Pastebin: yeah… There are alot of files to put on pastebin, sorry Done!

2. Pic's: are coming soon! added!

Thanks for the comment and thanks for the warm welcoming!
Edited on 09 November 2016 - 01:27 PM
Bomb Bloke #4
Posted 19 May 2016 - 11:28 PM
The rules don't make it clear as to how scoring works. Do three pikes beat two stars, for example?

You could cut down on your file count dramatically by embedding all those NFPs into the main script.

This is the sort of game that could really benefit from sound. If you had it output a redstone pulse while dealing cards etc, an attached Note Block could play a "tick" noise or something.

You're using recursive function calls in order to loop (more specifically, you're having the script re-run itself over and over). This led to a crash after I played several hands, once the function stack reached its limit. Remember, if a running function instance calls another function, the former stays in memory waiting for the latter to end so it can resume from where it left off - there's a limit to how many function calls you can have active at once! See this guide re implementing some proper while / for loops.

It's pretty good, though, all in all.
Edited on 19 May 2016 - 09:45 PM
DesertEagle-2000 #5
Posted 20 May 2016 - 07:05 AM
First off, about the rules, thanks for saying. Will edit that. Second off, do you mean putting the images in a table in a script? Third, ok will add in. It's just unfortunate that computers have sounds on their own :(/> And last, yeah I know. All my games have that and I thought it was a computercraft limit from how much it could draw. Anyway, apart from the guide you gave me, I don't know a way around it. I'll look into the guide as soon as I come home (school :(/> ). Thanks for the review an I'll do my best to improve the game.
Bomb Bloke #6
Posted 20 May 2016 - 09:50 AM
Second off, do you mean putting the images in a table in a script?

That'd be the easiest way to do it, yes.

And last, yeah I know. All my games have that and I thought it was a computercraft limit from how much it could draw. Anyway, apart from the guide you gave me, I don't know a way around it.

The error I'm referring to - the "array index out of bounds" one - is more specifically a LuaJ one. You should expect every variety of Lua to crash in a similar manner if you write your code that way, but some will allow you more function calls than others, and you'll typically get different error messages telling you about it.

It'd be well worth going through and applying indentation to your code. You'll find it dramatically easier to read and debug with all the code blocks neatly formatted.
Edited on 20 May 2016 - 11:46 PM