xboxscene.org forums

Pages: 1 [2] 3 4

Author Topic: What Do You Guys Think Of This  (Read 1334 times)

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
What Do You Guys Think Of This
« Reply #15 on: April 21, 2004, 01:37:00 PM »

smile.gif  Just one to go, and that's a piece of cake, programming.

BenJeremy: The actiondrawlist stuff will help a lot in fast animations.  When can we expect to see it?

<---- BTW, head mod  cool.gif

Edit: And a semitransparent white png image for the cursor will look better.
Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
What Do You Guys Think Of This
« Reply #16 on: April 21, 2004, 02:38:00 PM »

CODE

// ######################
// Script: Tic Tac Colors
// Author: flattspott
// Version 0.1
// Disclaimer: WIP only
// ######################

OnError Goto ErrorHandler
Set Wins 0
Set Loses 0
Set Draws 0
Set Turn 0
// LoadImage Back $ActualPath$\ttcback.png
Goto Start
:NewGame
:Start
Set PointerLeft 272
Set PointerTop 195

// LEFT POSITIONS
Set Left0 194
Set Left1 250
Set Left2 306
Set Left3 194
Set Left4 250
Set Left5 306
Set Left6 194
Set Left7 250
Set Left8 306
// TOP POSITIONS
For T1 = 0 To 2
  Set Top%T1% 94
Next
For T2 = 3 To 5
  Set Top%T2% 150
Next
For T3 = 6 To 8
  Set Top%T3% 206
Next
// WIDTH AND HEIGTH
For WH = 0 To 8
  Set Width%WH% 48
  Set Height%WH% 48
Next
// COLOR ALL SPOTS TO UNOCCUPIED COLOR
For C = 0 To 8
  Set Color%C% BLACK
Next
// TEXT FOR UNOCCUPIED SPOTS
For TX = 0 To 8
   Set Text%TX% ""
Next

// DETERMINE WHO GETS THE FIRST MOVE
If# %Turn% == 1 Then
  Set Text4 "O"
  Set Color4 RED
EndIf
GoSub SwitchTurn
Goto RefreshScreen

:RefreshScreen
BeginDraw
Box 0 0 640 480 DARKBLUE DARKBLUE
Box 190 90 167 167 DARKGRAY DARKGRAY
Box %Left0% %Top0% %Width0% %Height0%  %Color0% %Color0%
Box %Left1% %Top1% %Width1% %Height1%  %Color1% %Color1%
Box %Left2% %Top2% %Width2% %Height2%  %Color2% %Color2%
Box %Left3% %Top3% %Width3% %Height3%  %Color3% %Color3%
Box %Left4% %Top4% %Width4% %Height4%  %Color4% %Color4%
Box %Left5% %Top5% %Width5% %Height5%  %Color5% %Color5%
Box %Left6% %Top6% %Width6% %Height6%  %Color6% %Color6%
Box %Left7% %Top7% %Width7% %Height7%  %Color7% %Color7%
Box %Left8% %Top8% %Width8% %Height8%  %Color8% %Color8%
Text 216 110 Center "%Text0%"
Text 272 110 Center "%Text1%"
Text 329 110 Center "%Text2%"
Text 216 163 Center "%Text3%"
Text 272 163 Center "%Text4%"
Text 332 163 Center "%Text5%"
Text 216 220 Center "%Text6%"
Text 272 220 Center "%Text7%"
Text 329 220 Center "%Text8%"
Text 221 275 Left "Scoreboard"
Text 221 300 Left "Wins: "
Text 333 300 Right "%Wins%"
Text 221 320 Left "Loses: "
Text 333 320 Right "%Loses%"
Text 221 340 Left "Draws: "
Text 333 340 Right "%Draws%"
Box 217 271 120 96 0x00FFFFFF 0xFFFFFFFF
// Image Back 0 0 640 480
Box %PointerLeft% %PointerTop% 5 5 WHITE WHITE
EndDraw
If# %Retrieve% == 1 Then
Return
EndIf

// INPUT HANDLER
IQWaitMsg ANY
IF %MSG_ID% == "UI_VIRTKB" Goto StealSpot
IF %MSG_ID% == "SYS_MENU" Goto Help
IF %MSG_ID% == "MUSIC_NEXT" Goto Options
IF %MSG_ID% == "UI_UP" Goto MovePtrUp
IF %MSG_ID% == "UI_DN" Goto MovePtrDown
IF %MSG_ID% == "UI_RT" Goto MovePtrRight
IF %MSG_ID% == "UI_LF" Goto MovePtrLeft
IF %MSG_ID% == "UI_SELECT" Goto Click
IF %MSG_ID% == "UI_BACK" Goto End
Goto RefreshScreen

:SwitchTurn
If %Turn% == 1 Then
  Set Turn 0
Else
  Set Turn 1
EndIf
Return

:StealSpot
GoSub GetCurrent
If %Text{Current}% == "O" Then
  Set Text%Current% "X"
  Set Color%Current% BLUE
EndIf
Goto RefreshScreen

:MovePtrUp
If# %PointerTop% == 139 Goto RefreshScreen
Sub PointerTop 56
Goto RefreshScreen
:MovePtrDown
If# %PointerTop% == 251 Goto RefreshScreen
Add PointerTop 56
Goto RefreshScreen
:MovePtrRight
If# %PointerLeft% == 328 Goto RefreshScreen
Add PointerLeft 56
Goto RefreshScreen
:MovePtrLeft
If# %PointerLeft% == 216 Goto RefreshScreen
Sub PointerLeft 56
Goto RefreshScreen

:Click
  GoSub GetCurrent
  If %Text{Current}% == "" Then
      Set Text%Current% "X"
      Set Color%Current% BLUE
      Set Retrieve 1
      GoSub BlockMove
      GoSub RefreshScreen
      Set Retrieve 0
  EndIf
  Set Retrieve 1
  GoSub RefreshScreen
  GoSub WinCheckX
  Set Retrieve 0
  GoSub WinCheckO
  GoSub CheckForDraw
Goto RefreshScreen

:CheckForDraw
Set Temp 0
For DrawCheck = 0 To 8
  If %Text{DrawCheck}% > "" Then
     Add Temp 1
  EndIf
Next
If %Temp% >= 8 Then
  Goto DrawGame
EndIf
Return

:GetCurrent
// CHECK POINTER POSITION AND SET THE CURRENT BOX ACCORDINGLY
If# %PointerLeft% == 216 Then
  If %PointerTop% == 139 Then
     Set Current 0
  EndIf
EndIf
If# %PointerLeft% == 272 Then
  If# %PointerTop% == 139 Then
     Set Current 1
  EndIf
EndIf
If# %PointerLeft% == 328 Then
  If# %PointerTop% == 139 Then
     Set Current 2
  EndIf
EndIf
If# %PointerLeft% == 216 Then
  If# %PointerTop% == 195 Then
     Set Current 3
  EndIf
EndIf
If# %PointerLeft% == 272 Then
  If# %PointerTop% == 195 Then
     Set Current 4
  EndIf
EndIf
If# %PointerLeft% == 328 Then
  If# %PointerTop% == 195 Then
     Set Current 5
  EndIf
EndIf
If# %PointerLeft% == 216 Then
  If# %PointerTop% == 251 Then
     Set Current 6
  EndIf
EndIf
If# %PointerLeft% == 272 Then
  If# %PointerTop% == 251 Then
     Set Current 7
  EndIf
EndIf
If# %PointerLeft% == 328 Then
  If# %PointerTop% == 251 Then
     Set Current 8
  EndIf
EndIf
Return

:BlockMove
Set BlockMade 0
If %Text0% == "" Then
  If %Text1% == "X" Then
     If %Text2% == "X" Then
        Set Text0 "O"
        Set Color0 RED
        Set BlockMade 1
        Goto EndBlockMove
     EndIf
  EndIf
EndIf
If %Text0% == "X" Then
  If %Text1% == "" Then
     If %Text2% == "X" Then
        Set Text1 "O"
        Set Color1 RED
        Set BlockMade 1
        Goto EndBlockMove
     EndIf
  EndIf
EndIf
If %Text0% == "X" Then
  If %Text1% == "X" Then
     If %Text2% == "" Then
        Set Text2 "O"
        Set Color2 RED
        Set BlockMade 1
        Goto EndBlockMove
     EndIf
  EndIf
EndIf
If %Text3% == "" Then
  If %Text4% == "X" Then
     If %Text5% == "X" Then
        Set Text3 "O"
        Set Color3 RED
        Set BlockMade 1
        Goto EndBlockMove
     EndIf
  EndIf
EndIf
If %Text3% == "X" Then
  If %Text4% == "" Then
     If %Text5% == "X" Then
        Set Text4 "O"
        Set Color4 RED
        Set BlockMade 1
        Goto EndBlockMove
     EndIf
  EndIf
EndIf
If %Text3% == "X" Then
  If %Text4% == "X" Then
     If %Text5% == "" Then
        Set Text5 "O"
        Set Color5 RED
        Set BlockMade 1
        Goto EndBlockMove
     EndIf
  EndIf
EndIf
If %Text6% == "" Then
  If %Text7% == "X" Then
     If %Text8% == "X" Then
        Set Text6 "O"
        Set Color6 RED
        Set BlockMade 1
        Goto EndBlockMove
     EndIf
  EndIf
EndIf
If %Text6% == "X" Then
  If %Text7% == "" Then
     If %Text8% == "X" Then
        Set Text7 "O"
        Set Color7 RED
        Set BlockMade 1
        Goto EndBlockMove
     EndIf
  EndIf
EndIf
If %Text6% == "X" Then
  If %Text7% == "X" Then
     If %Text8% == "" Then
        Set Text8 "O"
        Set Color8 RED
        Set BlockMade 1
        Goto EndBlockMove
     EndIf
  EndIf
EndIf
If %Text0% == "" Then
  If %Text4% == "X" Then
     If %Text8% == "X" Then
        Set Text0 "O"
        Set Color0 RED
        Set BlockMade 1
        Goto EndBlockMove
     EndIf
  EndIf
EndIf
If %Text0% == "X" Then
  If %Text4% == "" Then
     If %Text8% == "X" Then
        Set Text4 "O"
        Set Color4 RED
        Set BlockMade 1
        Goto EndBlockMove
     EndIf
  EndIf
EndIf
If %Text0% == "X" Then
  If %Text4% == "X" Then
     If %Text8% == "" Then
        Set Text8 "O"
        Set Color8 RED
        Set BlockMade 1
        Goto EndBlockMove
     EndIf
  EndIf
EndIf
If %Text2% == "" Then
  If %Text4% == "X" Then
     If %Text6% == "X" Then
        Set Text2 "O"
        Set Color2 RED
        Set BlockMade 1
        Goto EndBlockMove
     EndIf
  EndIf
EndIf
If %Text2% == "X" Then
  If %Text4% == "" Then
     If %Text6% == "X" Then
        Set Text4 "O"
        Set Color4 RED
        Set BlockMade 1
        Goto EndBlockMove
     EndIf
  EndIf
EndIf
If %Text2% == "X" Then
  If %Text4% == "X" Then
     If %Text6% == "" Then
        Set Text6 "O"
        Set Color6 RED
        Set BlockMade 1
        Goto EndBlockMove
     EndIf
  EndIf
EndIf
:EndBlockMove
If# %BlockMade% == 1 Then
  Return
Else
  Set WinMade 0
  If %Text0% == "" Then
     If %Text1% == "O" Then
        If %Text2% == "O" Then
           Set Text0 "O"
           Set Color0 RED
           Set WinMade 1
           Goto EndWinMove
        EndIf
     EndIf
  EndIf
  If %Text0% == "O" Then
     If %Text1% == "" Then
        If %Text2% == "O" Then
           Set Text1 "O"
           Set Color1 RED
           Set WinMade 1
           Goto EndWinMove
        EndIf
     EndIf
  EndIf
  If %Text0% == "O" Then
     If %Text1% == "O" Then
        If %Text2% == "" Then
           Set Text2 "O"
           Set Color2 RED
           Set WinMade 1
           Goto EndWinMove
        EndIf
     EndIf
  EndIf
  If %Text3% == "" Then
     If %Text4% == "O" Then
        If %Text5% == "O" Then
           Set Text3 "O"
           Set Color3 RED
           Set WinMade 1
           Goto EndWinMove
        EndIf
     EndIf
  EndIf
  If %Text3% == "O" Then
     If %Text4% == "" Then
        If %Text5% == "O" Then
           Set Text4 "O"
           Set Color4 RED
           Set WinMade 1
           Goto EndWinMove
        EndIf
     EndIf
  EndIf
  If %Text3% == "O" Then
     If %Text4% == "O" Then
        If %Text5% == "" Then
           Set Text5 "O"
           Set Color5 RED
           Set WinMade 1
           Goto EndWinMove
        EndIf
     EndIf
  EndIf
  If %Text6% == "" Then
     If %Text7% == "O" Then
        If %Text8% == "O" Then
           Set Text6 "O"
           Set Color6 RED
           Set WinMade 1
           Goto EndWinMove
        EndIf
     EndIf
  EndIf
  If %Text6% == "O" Then
     If %Text7% == "" Then
        If %Text8% == "O" Then
           Set Text7 "O"
           Set Color7 RED
           Set WinMade 1
           Goto EndWinMove
        EndIf
     EndIf
  EndIf
  If %Text6% == "O" Then
     If %Text7% == "O" Then
        If %Text8% == "" Then
           Set Text8 "O"
           Set Color8 RED
           Set WinMade 1
           Goto EndWinMove
        EndIf
     EndIf
  EndIf
  If %Text0% == "" Then
     If %Text4% == "O" Then
        If %Text8% == "O" Then
           Set Text0 "O"
           Set Color0 RED
           Set WinMade 1
           Goto EndWinMove
        EndIf
     EndIf
  EndIf
  If %Text0% == "O" Then
     If %Text4% == "" Then
        If %Text8% == "O" Then
           Set Text4 "O"
           Set Color4 RED
           Set WinMade 1
           Goto EndWinMove
        EndIf
     EndIf
  EndIf
  If %Text0% == "O" Then
     If %Text4% == "O" Then
       If %Text8% == "" Then
           Set Text8 "O"
           Set Color8 RED
           Set WinMade 1
           Goto EndWinMove
        EndIf
     EndIf
  EndIf
  If %Text2% == "" Then
     If %Text4% == "O" Then
        If %Text6% == "O" Then
           Set Text2 "O"
           Set Color2 RED
           Set WinMade 1
           Goto EndWinMove
        EndIf
     EndIf
  EndIf
  If %Text2% == "O" Then
     If %Text4% == "" Then
        If %Text6% == "O" Then
           Set Text4 "O"
           Set Color4 RED
           Set WinMade 1
           Goto EndWinMove
        EndIf
     EndIf
  EndIf
  If %Text2% == "O" Then
     If %Text4% == "O" Then
        If %Text6% == "" Then
           Set Text6 "O"
           Set Color6 RED
           Set WinMade 1
           Goto EndWinMove
        EndIf
     EndIf
  EndIf
EndIf
:EndWinMove
If %WinMade% == 0 GoSub SeekEmpty
Return

:SeekEmpty
// HOW THE XBOX WILL DECIDE WHICH SPOT TO MARK
SetFunc XboxMove Left 1 $rand$
If# %XboxMove% > 8 Goto SeekEmpty
If %Text{XboxMove}% == "X" Goto SeekEmpty
If %Text{XboxMove}% == "O" Goto SeekEmpty
Set Text%XboxMove% "O"
Set Color%XboxMove% RED
Return

:WinCheckX
// CHECK ROW 1
If %Text0% == "X" Then
   If %Text1% == "X" Then
      If %Text2% == "X" Then
        Goto HumanWins
      EndIf
   EndIf
EndIf
// CHECK ROW 2
If %Text3% == "X" Then
   If %Text4% == "X" Then
      If %Text5% == "X" Then
        Goto HumanWins
      EndIf
   EndIf
EndIf
// CHECK ROW 3
If %Text6% == "X" Then
   If %Text7% == "X" Then
      If %Text8% == "X" Then
        Goto HumanWins
      EndIf
   EndIf
EndIf
// CHECK COLUMN 1
If %Text0% == "X" Then
   If %Text3% == "X" Then
      If %Text6% == "X" Then
        Goto HumanWins
      EndIf
   EndIf
EndIf
// CHECK COLUMN 2
If %Text1% == "X" Then
   If %Text4% == "X" Then
      If %Text7% == "X" Then
        Goto HumanWins
      EndIf
   EndIf
EndIf
// CHECK COLUMN 3
If %Text2% == "X" Then
   If %Text5% == "X" Then
      If %Text8% == "X" Then
          Goto HumanWins
      EndIf
   EndIf
EndIf
// CHECK DIAGONAL 1
If %Text0% == "X" Then
  If %Text4% == "X" Then
     If %Text8% == "X" Then
        Goto HumanWins
     EndIf
   EndIf
EndIf
// CHECK DIAGONAL 2
If %Text2% == "X" Then
  If %Text4% == "X" Then
     If %Text6% == "X" Then
        Goto HumanWins
     EndIf
   EndIf
EndIf
Return

:WinCheckO
DelayMS 200
// CHECK ROW 1
If %Text0% == "O" Then
   If %Text1% == "O" Then
      If %Text2% == "O" Then
         Goto XboxWins
      EndIf
   EndIf
EndIf
// CHECK ROW 2
If %Text3% == "O" Then
   If %Text4% == "O" Then
      If %Text5% == "O" Then
         Goto XboxWins
      EndIf
   EndIf
EndIf
// CHECK ROW 3
If %Text6% == "O" Then
   If %Text7% == "O" Then
      If %Text8% == "O" Then
         Goto XboxWins
      EndIf
   EndIf
EndIf
// CHECK COLUMN 1
If %Text0% == "O" Then
   If %Text3% == "O" Then
      If %Text6% == "O" Then
         Goto XboxWins
      EndIf
   EndIf
EndIf
// CHECK COLUMN 2
If %Text1% == "O" Then
   If %Text4% == "O" Then
      If %Text7% == "O" Then
         Goto XboxWins
      EndIf
   EndIf
EndIf
// CHECK COLUMN 3
If %Text2% == "O" Then
   If %Text5% == "O" Then
      If %Text8% == "O" Then
         Goto XboxWins
      EndIf
   EndIf
EndIf
// CHECK DIAGONAL 1
If %Text0% == "O" Then
  If %Text4% == "O" Then
     If %Text8% == "O" Then
         Goto XboxWins
     EndIf
   EndIf
EndIf
// CHECK DIAGONAL 2
If %Text2% == "O" Then
  If %Text4% == "O" Then
     If %Text6% == "O" Then
         Goto XboxWins
     EndIf
   EndIf
EndIf
Return

:DrawGame
MsgBox "This game is a draw"
Add Draws 1
Goto NewGame

:HumanWins
MsgBox "You win, Xbox loses"
Add Wins 1
Goto NewGame

:XboxWins
MsgBox "Xbox Wins, You lose"
Add Loses 1
Goto NewGame

:Help
MsgBox "Help$eol$Not done yet"
Goto RefreshScreen

:Options
MsgBox "Options$eol$Not done yet"
Goto RefreshScreen

:ErrorHandler
RAISELASTERROR

:End
// CloseImage Back
Logged

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
What Do You Guys Think Of This
« Reply #17 on: April 22, 2004, 02:48:00 AM »

dry.gif

Other than that, I'd test it if I had a working xbox...  dry.gif again
Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
What Do You Guys Think Of This
« Reply #18 on: April 22, 2004, 03:10:00 AM »

Let me guess, something like

Set wTemp 0
For i = 0 To 2
...
Set wTemp 0
For i = 3 To 5
...
Set wTemp 0
For i = 6 To 8
Logged

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
What Do You Guys Think Of This
« Reply #19 on: April 22, 2004, 04:00:00 AM »

tongue.gif

SET Wtemp 0

FOR I = 0 to 2
SET temp %I%
MULT temp 3
SET temp2 %temp%
ADD temp2 2
FOR J = %temp% to %temp2%


***Hate this SET and ADD and MULT stuff... hopefully expression evaluation will be done soon
Logged

EcL|PsE

  • Archived User
  • Full Member
  • *
  • Posts: 174
What Do You Guys Think Of This
« Reply #20 on: April 23, 2004, 10:23:00 AM »

arkanoid would make me shit my pants
Logged

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
What Do You Guys Think Of This
« Reply #21 on: April 23, 2004, 03:46:00 PM »

biggrin.gif
Logged

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
What Do You Guys Think Of This
« Reply #22 on: April 23, 2004, 04:26:00 PM »

QUOTE (geniusalz @ Apr 22 2004, 06:48 AM)
You do know that your win-checking could be done in about 1/3 of the code  dry.gif

Other than that, I'd test it if I had a working xbox...  dry.gif again

 uhh.gif

What do you mean by that last line?
Logged

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
What Do You Guys Think Of This
« Reply #23 on: April 23, 2004, 04:37:00 PM »

Yeah, little accident playing around with it... but I've got a spare one now.
Logged

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
What Do You Guys Think Of This
« Reply #24 on: April 23, 2004, 05:00:00 PM »

QUOTE (geniusalz @ Apr 23 2004, 08:37 PM)
Yeah, little accident playing around with it... but I've got a spare one now.

If anybody's interested, I just posted a link in Comedy.... about a phone "Conversation" I had tonight.

It is Xbox related, and even related to MXM, in a way, since I was doing research when the idea hit me.

It was a very evil prank. Good thing my buddy has a sense of humor.  laugh.gif
Logged

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
What Do You Guys Think Of This
« Reply #25 on: April 23, 2004, 05:51:00 PM »

QUOTE (BenJeremy @ Apr 23 2004, 09:00 PM)
If anybody's interested, I just posted a link in Comedy.... about a phone "Conversation" I had tonight.

It is Xbox related, and even related to MXM, in a way, since I was doing research when the idea hit me.

It was a very evil prank. Good thing my buddy has a sense of humor.  laugh.gif

 laugh.gif

But you quoted me when you said that... which makes me think about the other twisted (unintentional!) meaning my simple sentence has, which reminded you of your story...
Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
What Do You Guys Think Of This
« Reply #26 on: April 23, 2004, 06:10:00 PM »

QUOTE
It is Xbox related, and even related to MXM, in a way, since I was doing research when the idea hit me


Interesting indeed
Logged

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
What Do You Guys Think Of This
« Reply #27 on: April 23, 2004, 06:13:00 PM »

Research on voice... sounds interesting.
Logged

chilin_dude

  • Archived User
  • Hero Member
  • *
  • Posts: 3068
What Do You Guys Think Of This
« Reply #28 on: April 24, 2004, 12:20:00 AM »

w00t someone is going to do a arkanoid clone!!!!!
OMFG that is the best, that game rocks sooooo much!!! You will be my hero for ever!!!
Flattspot, isn't this finished anyways??!??
Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
What Do You Guys Think Of This
« Reply #29 on: April 24, 2004, 06:54:00 AM »

It is playable now if that's what you mean. MXM WIP only though. You'd have to read the input stuff in the script to see what controls do what.
Logged
Pages: 1 [2] 3 4