Jump to content


Photo

Anybuddy Want To Do A Yahtzee Clone


  • Please log in to reply
No replies to this topic

#1 flattspott

flattspott

    X-S Freak

  • Moderator
  • PipPipPipPipPip
  • 1,787 posts
  • Location:Southern California
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 03 October 2004 - 08:51 PM

He what I got so far for a resourceless WIP. Like I said I a WIP. I was mainly doing the dice rolling,holding and drawing at the moment.

Stick it in $ActualPath$\whatever.xas to see it so far

CODE
// Yahtzee
MinimumBuild 1230

Set Mark 1
Set Players 1

:NewDice
For i = 1 To 5
Set Hold%i% 0
Next

Gosub RollDice

Set dL1 115
Set dL2 173
Set dL3 231
Set dL4 288
Set dL5 345
Set Data1 0000000000001000000000000
Set Data2 0000001000000000001000000
Set Data3 0000001000001000001000000
Set Data4 0000001010000000101000000
Set Data5 0000001010001000101000000
Set Data6 0000001010010100101000000

:GameLoop
SetFunc Input IQPeekMsgID
If %Input% != "" Gosub InputHandler
Gosub DrawGame
Goto GameLoop

:InputHandler
IQWaitMsg Any
Switch %MSG_ID%
Case UI_LF
 If# %Mark% != 1 Then
  Sub Mark 1
 EndIf
EndCase
Case UI_RT
 If# %Mark% != 5 Then
  Add Mark 1
 EndIf
EndCase
Case UI_SELECT
 If# %Hold{Mark}% == 0 Then
  Set Hold%Mark% 1
 Else
  Set Hold%Mark% 0
 EndIf
EndCase
Case MUSIC_NEXT
 Gosub RollDice
EndCase
Case UI_BACK
 Quit
EndCase
EndSwitch
Return



:RollDice
For i = 1 To 5
If# %Hold{i}% == 1 Goto NoRoll
Set Dice%i% %($rand%6+1)%
:NoRoll
Next
Return

:DrawGame
BeginDraw
Text 220 240 Center "Dice 1 : %Dice1% %Hold1%$EOL$Dice 2 : %Dice2% %Hold2%$EOL$Dice 3 : %Dice3% %Hold3%$EOL$Dice 4 : %Dice4% %Hold4%$EOL$Dice 5 : %Dice5% %Hold5%" Red

For i = 1 To 5
If# %Hold{i}% == 1 Then
Gosub HoldIt%i%
Goto Stop
EndIf
Set globalLeft %dL{i}%
Gosub Make%Dice{i}%
Set Z 0
For T = 0 To 4
For L = 0 To 4
 SetFunc ToDraw Mid %Z% 1 %Array%
 If# %ToDraw% == 0 Then
  Box %(L*10+globalLeft)% %(T*10+100)% 10 10 White White
 Else
  Box %(L*10+globalLeft)% %(T*10+100)% 10 10 Red Red
 EndIf
 Add Z 1
Next
Next
:Stop
Next

EndDraw
Return

:Make1
Set Array %Data1%
Return
:Make2
Set Array %Data2%
Return
:Make3
Set Array %Data3%
Return
:Make4
Set Array %Data4%
Return
:Make5
Set Array %Data5%
Return
:Make6
Set Array %Data6%
Return

:HoldIt1
Box 110 110 60 60 Orange Orange
Return
:HoldIt2
Box 168 110 60 60 Orange Orange
Return
:HoldIt3
Box 226 110 60 60 Orange Orange
Return
:HoldIt4
Box 283 110 60 60 Orange Orange
Return
:HoldIt5
Box 340 110 60 60 Orange Orange
Return
<Dice>
<Die Value="1" Data="0000000000001000000000000"/>
<Die Value="2" Data="0000001000000000001000000"/>
<Die Value="3" Data="0000001000001000001000000"/>
<Die Value="4" Data="0000001010000000101000000"/>
<Die Value="5" Data="0000001010001000101000000"/>
<Die Value="6" Data="0000001010010100101000000"/>
</Dice>






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users