Well, as a break from MoneyWalrii, I am making the game of pig, link to explanation soon. I have the opening scene done; as seen in the video.

Also, does anyone have any suggestions for a different animal rather than a pig?

https://m.youtube.com/watch?v=ZSEEa434msk

Oh yeah, and the background noise is a Marx brothers movie ;D

EDUT: Link to Explanation: http://cs.gettysburg.edu/projects/pig/piggame.html
Bump

I have added the action menu with alternating players, now I have to start creating the actual game. Smile
Bump, again. Sad
I have finished the two player part of the game, so I'm going to attemp to make an A I for a one player game.
Good Luck!
Thanks, I have a video for all who want to check out the gameplay. I think I am going to make the text a different color when player two comes along for better visibility.

Follow along using the link I posted above!

http://www.youtube.com/watch?v=9gQrJs4f2PM
UPDATE!

So I took the time to type this in to sourcecoder, and now, we have a real screenshot!



The pinkish text towards the end says that you rolled a one, and your turn total is now 0. If player one had pressed hold he would have kept his score and passed play on the player two, rather than not getting a point and passing it on the player two.

The glitches in the screenie are emulator caused, it always does something with lines when inverting the colors.
The gif looks like you are using Output to display the text and stuff. In half-resolution mode, you should use http://dcs.cemetech.net/index.php/DCSE:BasicLibs:DrawString so that it looks normal. That is what I did in Song Lyrics CSE. An alternative to that would be not using half-resolution. You would just have to say real(0,3,4,0,1) twice to get the whole screen black. Also, I get really annoyed with emulators sometimes too. I just uploaded Song Lyrics CSE to the queue, and my program worked perfectly on the calculator, but jsTIfied was messing it up. So I created a demo of the backgrounds in a program.

At the end of your gif, you can see that the text looks normal as you exit half-resolution.
Oh look, its not a bump Razz

Anyways, the AI should be done tomorrow, along with different P2 colors. The XLIBC display text command will come later. So yeah, I hardly had to do a thing to set the AI up Shock
Game of Pig is done!

So, head over here to download it.

Screenshots:
Two Player Game:

One Player Game:


EDIT: Changed download link to Cemetech one.
readroof2 wrote:
The gif looks like you are using Output to display the text and stuff. In half-resolution mode, you should use http://dcs.cemetech.net/index.php/DCSE:BasicLibs:DrawString so that it looks normal.
You never addressed this question; I believe that you probably should. I agree that it seems a little pointless to put the calculator in half-resolution mode and then use the native text output options.
I had answered it in IRC, but, again, I wanted to get it done, and using DrawString is time consuming, finding which coordinates to use. If you have downloaded the game, you will see in the readme that I mention converting to DrawString in the future.
If you want to use Output( instead of DrawString, you can just use real(0,3,4,0,1):real(0,3,4,0,1), and then you will have it look just like your current program, but with better looking text. All you would have to change is the second value in all of your Output( functions. And that would be very easy. You would just double that number for all of them, and if you did this with SourceCoder, just use Ctrl+F, search for Output(, and double those numbers. If any of this didn't make sense, just post a question about it.
Yeah, but sprites and things wouldn't be a possibility. Which I am adding. (I have the spritesheet almost done)



I just need to add a pig.
Bump

Welp, it turns out that those die were NOT 8x8, they were 9x9. So, I remade the spritesheet in to this:

I'm not that happy about losing the 3D feel, so pleas feel free to remake the die in 3D. (I don't trust myself to Razz)

Code:

:DCS
"33333333333333333B000000000000033B444000000444033B414000000414033B444000000444033B000000000000033B444000000444033B414000000414033B444000000444033B000000000000033B444000000444033B414000000414033B444000000444033B000000000000033B000000000000033333333333333333
If 80>det([[20:Then:Disp "Get Doors CSE to run this:","http://dcs.cemetech.net":Return:End
"GOPSPRT
real(5,0,0
real(0,1,1
real(0,1,0,0
100→T:2→P
DelVar ADelVar BDelVar KDelVar LDelVar MDelVar Y
real(0,3,4,0,1
real(0,3,4,0,0
det(12,255,255,0,0
Output(5,12,"The
While A≠50
A+1→A
End
Output(5,12,"   
For(B,1,10
real(0,1,1
det(12,255,255,randInt(1,255),randInt(1,255)
Output(5,5,"GAME
For(A,1,5
End
real(0,1,0
real(0,3,2
End
real(0,1,1
det(12,0,0,0,0
Output(5,5,"   
det(12,255,255,184,253
Output(4,4,"Of Pig.
For(A,1,15,1
End
real(8,1,0
det(12,52,15,0,0
Output(7,1,"PRESS [ENTER]
Pause
DelVar A
While A<100
A+1→A
getKey→K
If K
100→A
real(4,0,randInt(0,160),randInt(0,240),2,2,0,0,7,0,0,24,25,32,33,40,41
End
Lbl M
real(8,1,0
real(0,3,4,0,0
det(12,154,214,0,0
Output(1,1,"++++MENU!++++
Output(4,1,"1. ONE PLAYER
Output(5,1,"2. TWO PLAYER
Output(6,1,"3. QUIT
DelVar A
Repeat A>5 and A<9
getkey 
Ans-86→A
End
Lbl X
If A=8:Then
real(0,1,0,1
real(0,3,4,255,1
real(0,3,4,255,0
Stop
End
If A=7
Goto P
2→Y:2→E
Lbl P
DelVar IDelVar J
3-P→P
Lbl R
If P=1
DelVar Y
If P=2 and E=2
2→Y
If P=1
det(12,154,214,0,0
If P=2
det(12,174,14,0,0
real(0,3,4,0,0
If M≥100
Goto MW
If L≥100
Goto LW
"P1:
real(6,0,0,5,145,36,0
real(6,1,25,5,145,L,0
"P2:
real(6,0,110,5,145,36,0
real(6,1,135,5,145,M,0
Output(1,1,"++PLAYER:  ++
Output(1,11,P
Output(4,1,"1. ROLL
Output(5,1,"2. HOLD
Output(6,1,"3. QUIT
Output(8,1,"TURN TOTALS
Output(9,1,"P1:
Output(9,5,I
Output(10,1,"P2:
Output(10,5,J
If Y=2 and P=2:Then
For(A,0,400
End
End
If Y=2:Then
real(0,3,4,0,0
randInt(1,7→Q
If Q≥5
7→A
If Q<5
6→A
If J+M<L or J+M≤5
6→A
randInt(1,9→Q
If Q=2 or Q=8
7→A
If J>35
randInt(6,7→A
If J=0
6→A
If A=7
Output(1,5,"Hold!
If A=6
Output(1,5,"Roll!
For(B,0,300
End
End
If Y=2
Goto AI
DelVar K
While K<92
getKey→K
If K=92
6→A
If K=93
7→A
If K=94
8→A
End
real(0,3,4,0,0
If A=8
Goto X
Lbl AI
If A=7 and P=1
I+L→L
If A=7 and P=2
J+M→M
If A=7
Goto P
DelVar A
For(C,0,15
A+1→A
If A<4:Then 
A-1→S 
Else 
A+4(A<6→S
End
If A=6:Then
10→S
DelVar A
End
randInt(1,6→R
real(4,0,75,54,1,1,0,0,7,0,0,S
For(B,0,20
End
real(7,9,75,54,8,8,0
End
randInt(1,13→O
If O=5
1→R
If R=1
det(12,randInt(1,255),randInt(1,255)
If P=1
"P1 Rolled→Str1
If P=2
"P2 Rolled→Str1
Output(1,1,Str1
Output(1,13,R
Output(5,1,"TURN TOTAL
If R=1 and P=1
DelVar IDelVar R
If R=1 and P=2
DelVar JDelVar R
If P=1:Then
I+R→I
Output(5,12,I
End
If P=2:Then
J+R→J
Output(5,12,J
End
If P=1
800→A
If Y=2 and P=2
300→A
For(D,0,A
End
If R=0
Goto P
Goto R
Lbl LW
Repeat getKey
det(12,randInt(1,255),randInt(1,255)
Output(1,2,"PLAYER ONE
Output(2,3,"HAS WON!
End
Goto M
Lbl MW
Repeat getKey
det(12,randInt(1,255),randInt(1,255)
Output(1,2,"PLAYER TWO
Output(2,3,"HAS WON!
End
Goto M


EDIT: After a RAM clear the sprites were fixed. The same thing happened with Bejeweled, might it be a DCSE bug, or just a problem that a program caused?

Code:
If A=1
DelVar S
If A=2
1→S
If A=3
2→S
If A=4
8→S
If A=5
9→S

could be

Code:
If A<4:Then
A-1→S
Else
8(A=4)+9(A=5→S
End

saves 13 bytes and probably gains a little speed as well

Code:
While A<5
getKey→K
If K=92
6→A
If K=93
7→A
If K=94
8→A
End

could be

Code:
Repeat A>5 and A<9
getkey
Ans-86→A
End

Mostly a speed optimization here, but also 7 more bytes in your pocket Smile

Code:
If P=1
det(12,154,214,0,0
If P=2
det(12,174,14,0,0

could be

Code:
det(12,174-20(P=1),14+200(P=1),0,0

Same thing...
Thanks a ton for those optimizations, mr womp womp, now, I just need to get some 8x8 3D looking Die.

Might anyone be able to make something like this look 8x8? An online image resizer doesn't work X.X

I'll then convert it to a .png and put it in my spritesheet:


Oh yeah, and those weird glitches I was having with the sprite were fixed by a RAM clear Wink

Sorry for the large .gif

Code:
If A<4:Then
A-1→S
Else
8(A=4)+9(A=5→S
End

can be

Code:
If A<4:Then
A-1→S
Else
A+4(A<6→S
End

nothing big but i just thought i'd share. originally I was just going to do A+4 but I'm pretty sure A can be >= 6.

[EDIT]
unicorn, this isn't much, but what if you made it so that the white side of the die is always on top? that way you have slightly more realistic lighting Smile
Michael2_3B wrote:

Code:
If A<4:Then
A-1→S
Else
8(A=4)+9(A=5→S
End

can be

Code:
If A<4:Then
A-1→S
Else
A+4(A<6→S
End

nothing big but i just thought i'd share. originally I was just going to do A+4 but I'm pretty sure A can be >= 6.
[EDIT]
unicorn, this isn't much, but what if you made it so that the white side of the die is always on top? that way you have slightly more realistic lighting Smile

Wow, yes, A can be 6, and when it is = to 6, something else happens so you did good adding that (A<6) I hadn't noticed this 4+4=8 and 5+4=9 thing, great thinking!
[EDIT]

Code:
If R=0
Goto P
Goto R
Lbl LW
Repeat getKey
det(12,randInt(1,255),randInt(1,255)
Output(1,2,"PLAYER ONE
Output(2,3,"HAS WON!
End
Goto M
Lbl MW
Repeat getKey
det(12,randInt(1,255),randInt(1,255)
Output(1,2,"PLAYER ONE
Output(2,3,"HAS WON!

Don't think it's intended that only player one can win... might wanna look into that..., also, If R=0 can be replaced by If not(R
[EDIT2]
wait a minute...

Code:
If A<4:Then
A-1→S
Else
A+4(A<6→S
End

could be... Razz

Code:
expr(sub("01289",A,1→S
Michael2_3B wrote:

[EDIT]
unicorn, this isn't much, but what if you made it so that the white side of the die is always on top? that way you have slightly more realistic lighting Smile

What do you mean? I don't see... when making the die?

Code:
If P=1
"P1 Rolled->Str1
If P=2
"P2 Rolled->Str1

Code:
"P"+sub("12",P,1)+" Rolled->Str1
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement