Jump to content

Making a game, Want to help?


Recommended Posts

Here is a game, still in the making but it has a good foundation to it(it does have some bugs but I have worked around Most of them).Do as you wish with this code just keep my name on it. I made to have fun so have fun with it.If someone can tidy up my code it would help(Or Make PathFinding8() Better). If you want to help me make this game better post some ideas or even a funcion or two, Thx.

CODE
#cs ----------------------------------------------------------------------------

AutoIt Version: 3.2.12.1

Author: Fenix

Notes;227 Problem; There is a problem with All[$N].It is adding 227 to $N somewhere

in the code and I dont know where($N is always a local for the loop or function).

If someone can figure it out plz fix it

Yes I wrote it but I dont know how the hell it is happening.

On an other note if you have any ideas or functions you would like to add to help out my game, plz send them to me.

#ce ----------------------------------------------------------------------------

#include <ProgressConstants.au3>

#include <GUIConstants.au3>

#include <Math.au3>

#Include <Timers.au3>

;-----------------------------------------------------------

Global $width = 1000

Global $height = 700

Global $colms = 100 ;number of colms

Global $rows = 100 ;number of rows

Global $Total = 1000 ;Total objects not inclueding the walls

Global $WallXY [$Total][3]; a quick way to do a loop and to check if a wall XY is near rather then get object pos

Global $TotalMoves = $width + $height ; the total amount of moves an obect can move

Global $MovePlan[$Total + 1][$TotalMoves + 1];holds the planed moves

Global $MovesPast[$TotalMoves][3];holds past moves

Global $HalfRows

Global $HalfColms

Global $All[$Total + 227] ;The Last 10 are for Pathfinding

Global $AliveOrDead[$Total] ;to see if they are dead or alive

Global $AllFocus = 0 ; current object left clicked

Global $Wall[$Total] ;a wall

Global $WallNumber = 0 ; current wall count

Global $Action = 1; sets what to do when right mouse is clicked 1 move,2 build,3set human,4 set demon,5 set dragon,6 set beast,7 Attack

Global $Target[3] ;target area for click n snap

Global $Move[$TotalMoves]

Global $GoAgain = 0 ;adds one more move

Global $CurrentMake = 0

Global $CursorInfo[5] ; holds the cursor info

Global $MovePastNumber = 0 ;the current past move number

Global $MovePlanNumber[$TotalMoves] ; hold the planed moves

Global $CurrentPathFinding8[3] ; target square for Path finding

Global $MoveOnOff[$Total] ;if object can move

Global $AtackOnOff[$Total]

Global $AllXY[$Total + 227][3]; a quick way to do a loop and to check if a objects XY is near rather then get object pos

Global $starttime = _Timer_Init() ; how fast the game goes

Local $Z = 0 ;tells the left click to work or not to work

Local $WhileLoopCount[$TotalMoves] ;counts down then move by counting up

Local $LessCode = 0 ; so it uses less code

;-----------------------------------------------------------

;Opt("GUIOnEventMode", 0)

Opt("MouseCoordMode", 2)

$Shade = GUICreate("Shade", $width, $height + 150, 100, 100)

;GUISetState(@SW_SHOW)

SetRows()

SetColms()

$BeastLabel = GUICtrlCreateLabel("Beast", 10, 751, 39, 17)

$DemonLabel = GUICtrlCreateLabel("Demon", 10, 719, 38, 17)

$DragonLabel = GUICtrlCreateLabel("Dragon", 10, 735, 39, 17)

$HumanLabel = GUICtrlCreateLabel("Human", 10, 703, 38, 17)

$BeastProgress = GUICtrlCreateProgress(50, 759, 217, 9, $PBS_SMOOTH); $PBS_SMOOTH doesn't work for some reason

$Dragonprogress = GUICtrlCreateProgress(50, 743, 217, 9)

$Demonprogress = GUICtrlCreateProgress(50, 727, 217, 9)

$HumanProgress = GUICtrlCreateProgress(50, 711, 217, 9, $PBS_SMOOTH); $PBS_SMOOTH doesn't work for some reason

$BuildButton = GUICtrlCreateButton("Build A Base", 900, 703, 70, 20)

$HumanButton = GUICtrlCreateButton("Add a Human", 900, 723, 70, 20)

$DemonButton = GUICtrlCreateButton("Add a Demon", 900, 743, 70, 20)

$DragonButton = GUICtrlCreateButton("Add a Dragon", 900, 763, 70, 20)

$BeastButton = GUICtrlCreateButton("Add a Beast", 900, 783, 70, 20)

$BottomButton = GUICtrlCreateButton("v", 744, 766, 27, 25, 0)

$TopButton = GUICtrlCreateButton("^", 744, 718, 27, 25, 0)

$RightButton = GUICtrlCreateButton(">", 768, 742, 27, 25, 0)

$LeftButton = GUICtrlCreateButton("<", 720, 742, 27, 25, 0)

$LeftTopButton = GUICtrlCreateButton("\", 720, 718, 27, 25, 0)

$LeftBottomButton = GUICtrlCreateButton("/", 720, 766, 27, 25, 0)

$RightBottomButton = GUICtrlCreateButton("\", 768, 766, 27, 25, 0)

$RightTopButton = GUICtrlCreateButton("/", 768, 718, 27, 25, 0)

$CenterButton = GUICtrlCreateButton("0", 744, 742, 27, 25, 0)

$AIButton = GUICtrlCreateButton("Set To AI", 500, 750, 70, 20)

$PlayerButton = GUICtrlCreateButton("Set To Player", 400, 750, 70, 20)

$AttackButton = GUICtrlCreateButton("Attack", 450, 770, 70, 20)

;GUICtrlSetBkColor(-1, "Black")

GUISetState(@SW_SHOW)

GUICtrlSetData($HumanProgress, 50)

For $N = 0 To $Total - 1 Step 1 ;creates all so that $msg doesn't fuck up;this is part of the 227 problem;can't get rid of it Screws up my the game

CreateAll($N, -10, -10, "Black")

$AliveOrDead[$N] = 0

Next

For $N = 0 To $Total - 1 Step 1

$MoveOnOff[$N] = 0

Next

;CreateAll(0, 20, 10, "Black")

;CreateAll(1,30,20,"Black")

;CreateAll(2,40,10)

Func PathFinding8($:); find a path from point A to point B; Needs work ; Likes to go to every square in the room that is cloest to the target square before leaving the room

#Region Definitions

Local $A = $CurrentPathFinding8

Local $SetNumber = 0

Local $8Square[16]

Local $Choices[9]

Local $hold

Local $Direction

#EndRegion Definitions

#Region Set 8 squares

;0

$8Square[0] = $A[0]

$8Square[1] = $A[1] - FigRows(1)

;1

$8Square[2] = $A[0] + FigColms(1)

$8Square[3] = $A[1] - FigRows(1)

;2

$8Square[4] = $A[0] + FigColms(1)

$8Square[5] = $A[1]

;3

$8Square[6] = $A[0] + FigColms(1)

$8Square[7] = $A[1] + FigRows(1)

;4

$8Square[8] = $A[0]

$8Square[9] = $A[1] + FigRows(1)

;5

$8Square[10] = $A[0] - FigColms(1)

$8Square[11] = $A[1] + FigRows(1)

;6

$8Square[12] = $A[0] - FigColms(1)

$8Square[13] = $A[1]

;7

$8Square[14] = $A[0] - FigColms(1)

$8Square[15] = $A[1] - FigRows(1)

#EndRegion Set 8 squares

#cs Code for checking the traget area with vizual stuff

GUICtrlSetPos($All[$Total - 1], $B[0], $B[1])

GUICtrlSetBkColor($All[$Total - 1], 0x000090)

;GUICtrlSetState($All[$Total - 1], $GUI_DISABLE)

;GUICtrlSetState($All[$Total - 1], $GUI_HIDE)

$SetNumber = $Total - 10 ; tells on the

; code for vizual on the 8 surrounding squares

$SetNumber = $Total - 10 ; tells on the

For $N = 0 To 14 Step 2

;MsgBox(1,""," test " & " " & $SetNumber)

GUICtrlSetPos($All[$SetNumber], $8Square[$N], $8Square[$N + 1])

GUICtrlSetBkColor($All[$SetNumber], 0x000090)

;GUICtrlSetState($All[$SetNumber], $GUI_DISABLE)

;GUICtrlSetState($All[$SetNumber], $GUI_HIDE)

$SetNumber += 1

Next

$SetNumber = 0

#ce

#Region Logic code for the move

For $N = 0 To 7 Step 1 ;logic for wich to move to

Local $Temp1 = $B[0] - $8Square[$SetNumber]

Local $Temp2 = $B[1] - $8Square[$SetNumber + 1]

If $Temp1 / $Temp1 = -1 Then ; makes them absolute values

$Temp1 = $Temp1 * - 1

EndIf

If $Temp2 / $Temp2 = -1 Then ; makes them absolute values

$Temp2 = $Temp2 * - 1

EndIf

$Choices[$N] = Round(Sqrt(($Temp1) ^ 2 + ($Temp2) ^ 2), 2)

;MsgBox(1,"x ",$Temp1 & " y " $Temp2)

For $N2 = 0 To $WallNumber Step 1 ;checks to see if a wall is there

If $WallXY[$N2][0] + $HalfColms * .7 > $8Square[$SetNumber] And $WallXY[$N2][0] - $HalfColms * .7 < $8Square[$SetNumber] Then

If $WallXY[$N2][1] + $HalfRows * .7 > $8Square[$SetNumber + 1] And $WallXY[$N2][1] - $HalfRows * .7 < $8Square[$SetNumber + 1] Then

$Choices[$N] = $height + $width

;MsgBox(1,"","hit")

EndIf

EndIf

Next

If $MovePastNumber > 0 Then ;checks to see if its already been there

For $N3 = 1 To $MovePastNumber Step 1

If $MovesPast[$N3 - 1][0] + $HalfColms * .5 > $8Square[$SetNumber] And $MovesPast[$N3 - 1][0] - $HalfColms * .5 < $8Square[$SetNumber] Then

If $MovesPast[$N3 - 1][1] + $HalfRows * .5 > $8Square[$SetNumber + 1] And $MovesPast[$N3 - 1][1] - $HalfRows * .5 < $8Square[$SetNumber + 1] Then

;MsgBox(1,"","current no take " & $Choices[$N] & " current $N " & $N)

$Choices[$N] = $height + $width

EndIf

EndIf

Next

EndIf

;GUICtrlSetData($All[$N + ($Total - 10)], $Choices[$N]) ; set number on the label

If $N = 0 Then ; sets hold the first time though

$hold = $Choices[$N]

$Direction = $N

ElseIf $hold > $Choices[$N] Then ;compares all 8 squares around main square

$hold = $Choices[$N]

$Direction = $N

$MovesPast[$MovePastNumber][0] = $8Square[$SetNumber]

$MovesPast[$MovePastNumber][1] = $8Square[$SetNumber + 1]

;MsgBox(1,"","winner " & $hold & " Number of the count is " & $N)

;MsgBox(1,"","Past x " & $MovesPast[$MovePastNumber][0])

;MsgBox(1,"","past y " & $MovesPast[$MovePastNumber][1])

$MovePastNumber += 1

EndIf

$SetNumber = $SetNumber + 2

Next

#EndRegion

;MsgBox(1,"","winner " & $hold & " Number of the count is " & $Direction)

;MsgBox(1,"","End")

;MsgBox(1,"","stuff " & $hold & " < " & Round(Sqrt(($HalfColms)^2+($HalfRows)^2 ),1) )

If $GoAgain = -1 Then ; stops the last time from happening again

;MsgBox(1, "", "end hit")

Return -1

ElseIf $hold < (Round(Sqrt(($HalfColms) ^ 2 + ($HalfRows) ^ 2), 1)) * .60 Then ;makes it go 1 last time

$GoAgain = -1

;MsgBox(1, "", "hit")

Return $Direction

Else ;Normal return

Return $Direction

EndIf

EndFunc ;==>PathFinding8

Func DeleteAll($N) ; have not used yet

GUICtrlDelete($All[$N])

EndFunc ;==>DeleteAll

Func MoveSetPlan($N) ; moves to where PathFinding says to go

;MsgBox(1,"","object number " & $MovePlan[$N][$MovePlanNumber[$N]] & " " & $MovePlanNumber[$N] & " Moves")

Move($N, $MovePlan[$N][$WhileLoopCount[$N]])

EndFunc ;==>MoveSetPlan

Func ClickNSnap() ;snaps target area to grid

Local $A[3]

For $N = 0 To 1000 Step 1

If $Target[0] > FigColms($N) Then

$A[0] += $HalfColms

ElseIf $Target[0] <= FigColms($N) Then

;MsgBox(1, "", $A[0])

$A[0] = $A[0] / $HalfColms

ExitLoop

EndIf

Next

For $N = 0 To 1000 Step 1

If $Target[1] > FigRows($N) Then

$A[1] += $HalfRows

ElseIf $Target[1] <= FigRows($N) Then

;MsgBox(1, "", $A[1])

$A[1] = $A[1] / $HalfRows

ExitLoop

EndIf

Next

Return $A

EndFunc ;==>ClickNSnap

Func ActionPlan() ; tells what to do with the action

If $Action = 1 Then ; moves A to B

If $LessCode = 1 Then

$LessCode = 0

EndIf

MousePos()

Local $A[2]

$A = $Target

$MovePlanNumber[$AllFocus] = 0

$CurrentPathFinding8 = GetPos($AllFocus)

$MoveOnOff[$AllFocus] = 1

For $N = 0 To $TotalMoves Step 1

$B = PathFinding8($A)

If $B = -1 Then

;MsgBox(1, "", "object number " & $AllFocus)

;$MovePlan[$AllFocus][$N] = 20

$GoAgain = 0

$N = $TotalMoves

Else

$MovePlan[$AllFocus][$N] = $B

$MovePlanNumber[$AllFocus] += 1

$CurrentPathFinding8 = SetCurrent($MovePlan[$AllFocus][$N])

EndIf

;Sleep(100)

Next

$MovePastNumber = 0

ElseIf $Action = 2 Then; builds a base

BaseBuild($AllFocus)

$Action = 1

ElseIf $Action = 3 Then ; set human

MousePos()

$A = ClickNSnap()

;MsgBox(1, "CurrentMake ", $CurrentMake)

CreateAll($All[$CurrentMake], $A[0], $A[1], 0x007F00)

;MsgBox(1,"","current make " & $CurrentMake )

$CurrentMake += 1

$Action = 1

SoundPlay(@DesktopDir & "\Sun Rose\Sir.wav")

ElseIf $Action = 4 Then ; set demon

MousePos()

$A = ClickNSnap()

;MsgBox(1, "CurrentMake ", $CurrentMake)

CreateAll($All[$CurrentMake], $A[0], $A[1], 0xF20D0D)

$CurrentMake += 1

$Action = 1

SoundPlay(@DesktopDir & "\Sun Rose\Hello(What).wav")

ElseIf $Action = 5 Then ; set dragon

MousePos()

$A = ClickNSnap()

;MsgBox(1, "CurrentMake ", $CurrentMake)

CreateAll($All[$CurrentMake], $A[0], $A[1], 0x0000FF)

$CurrentMake += 1

$Action = 1

SoundPlay(@DesktopDir & "\Sun Rose\Noble.wav")

ElseIf $Action = 6 Then ; set beast

MousePos()

$A = ClickNSnap()

;MsgBox(1, "CurrentMake ", $CurrentMake)

CreateAll($All[$CurrentMake], $A[0], $A[1], 0x804000)

$CurrentMake += 1

$Action = 1

SoundPlay(@DesktopDir & "\Sun Rose\Roar.wav")

ElseIf $Action = 7 Then ; Attack ;would like to add this to the while loop; still working on this;this has the 227 problem but it is fixed for the time being

$A = GetPos($AllFocus)

For $N = 0 To $Total - 1 Step 1

;MsgBox(1,"Attack",$AllXY[$N + 227][0] & " " & $AllXY[$N + 227][1])

If Not($All[$N + 227] = $All[$AllFocus]) Then

If $A[0] + FigColms(1) + 1 > $AllXY[$N + 227][0] And ($A[0] - FigColms(1)) - 1 < $AllXY[$N + 227][0] Then

If ($A[1] + FigRows(1)) + 1 > $AllXY[$N + 227][1] And ($A[1] - FigRows(1)) - 1 < $AllXY[$N + 227][1] Then

;If Then

MsgBox(1, "Attack", $N & " was Attacked")

;EndIf

EndIf

EndIf

EndIf

Next

$Action = 1

EndIf

$Z = 0

EndFunc ;==>ActionPlan

Func SetCurrent($Move) ;set plan move up with moves

$A = $CurrentPathFinding8

If $Move = 0 Then

$A[1] = $A[1] - FigRows(1)

ElseIf $Move = 1 Then

$A[0] = $A[0] + FigColms(1)

$A[1] = $A[1] - FigRows(1)

ElseIf $Move = 2 Then

$A[0] = $A[0] + FigColms(1)

ElseIf $Move = 3 Then

$A[0] = $A[0] + FigColms(1)

$A[1] = $A[1] + FigRows(1)

ElseIf $Move = 4 Then

$A[1] = $A[1] + FigRows(1)

ElseIf $Move = 5 Then

$A[0] = $A[0] - FigColms(1);

$A[1] = $A[1] + FigRows(1);

ElseIf $Move = 6 Then

$A[0] = $A[0] - FigColms(1)

ElseIf $Move = 7 Then

$A[0] = $A[0] - FigColms(1)

$A[1] = $A[1] - FigRows(1)

EndIf

Return $A

EndFunc ;==>SetCurrent

Func Move($N, $Move);moves objects

$A = GetPos($N)

If $Move = 0 Then

$A[1] = $A[1] - FigRows(1)

ElseIf $Move = 1 Then

$A[0] = $A[0] + FigColms(1)

$A[1] = $A[1] - FigRows(1)

ElseIf $Move = 2 Then

$A[0] = $A[0] + FigColms(1)

ElseIf $Move = 3 Then

$A[0] = $A[0] + FigColms(1)

$A[1] = $A[1] + FigRows(1)

ElseIf $Move = 4 Then

$A[1] = $A[1] + FigRows(1)

ElseIf $Move = 5 Then

$A[0] = $A[0] - FigColms(1);

$A[1] = $A[1] + FigRows(1);

ElseIf $Move = 6 Then

$A[0] = $A[0] - FigColms(1)

ElseIf $Move = 7 Then

$A[0] = $A[0] - FigColms(1)

$A[1] = $A[1] - FigRows(1)

EndIf

;MsgBox(1,"",$N)

$AllXY[$N][0] = $A[0]

$AllXY[$N][1] = $A[1]

GUICtrlSetPos($All[$N], $A[0], $A[1])

;0x000090 ; blue

EndFunc ;==>Move

Func Focus($N) ;sets the focus on a objects

$AllFocus = $N

EndFunc ;==>Focus

Func FigColms($N) ;times the real pixl number time the grid colms X

Return $HalfColms * $N

EndFunc ;==>FigColms

Func FigRows($N) ;times the real pixl number time the grid rows Y

Return $HalfRows * $N

EndFunc ;==>FigRows

Func WallBuilding() ;empty

EndFunc ;==>WallBuilding

Func BaseBuild($N) ; part 1

$A = GetPos($N)

$A[0] = $A[0] + $HalfColms

$A[1] = $A[1] - $HalfRows * 2

CreateWall($A[0], $A[1])

$A[0] += $HalfColms

CreateWall($A[0], $A[1])

$A = BaseBuildMove(1, "Y", $A)

$A = BaseBuildMove(0, "X", $A)

$A = BaseBuildMove(0, "Y", $A)

$A[0] += $HalfColms

CreateWall($A[0], $A[1])

EndFunc ;==>BaseBuild

Func BaseBuildMove($BaseBuildMovetemp, $XY, $BaseBuildMoveArry) ; part 2 of Base Build

For $N = 1 To 4 Step 1

If $BaseBuildMovetemp = 1 And $XY = "Y" Then

;msgbox (1 , "help", "move one down")

$BaseBuildMoveArry[1] += $HalfRows

CreateWall($BaseBuildMoveArry[0], $BaseBuildMoveArry[1])

ElseIf $BaseBuildMovetemp = 1 And $XY = "X" Then

;msgbox (1 , "help", "move one right")

$BaseBuildMoveArry[0] += $HalfColms

CreateWall($BaseBuildMoveArry[0], $BaseBuildMoveArry[1])

ElseIf $BaseBuildMovetemp = 0 And $XY = "Y" Then

;msgbox (1 , "help", "move one up")

$BaseBuildMoveArry[1] -= $HalfRows

CreateWall($BaseBuildMoveArry[0], $BaseBuildMoveArry[1])

ElseIf $BaseBuildMovetemp = 0 And $XY = "X" Then

;msgbox (1 , "help", "move one left")

$BaseBuildMoveArry[0] -= $HalfColms

CreateWall($BaseBuildMoveArry[0], $BaseBuildMoveArry[1])

EndIf

Next

Return $BaseBuildMoveArry

EndFunc ;==>BaseBuildMove

Func SetRows() ;makes the rows

$temp = $height / $rows

$orgainalTemp = $temp

$HalfRows = $orgainalTemp

;MsgBox(1,"help", $temp) ; for testing

For $x = 0 To $height - 1 Step $orgainalTemp

GUICtrlCreateLabel("", 0, $temp, $width, 1)

GUICtrlSetState(-1, $GUI_DISABLE)

GUICtrlSetBkColor(-1, "Black")

$temp = $temp + $orgainalTemp

Next

EndFunc ;==>SetRows

Func SetColms() ;makes the colms

$temp = $width / $colms

$orgainalTemp = $temp

$HalfColms = $orgainalTemp

;MsgBox(1,"help", $temp) ; for testing

For $x = 0 To $width - 1 Step $orgainalTemp

GUICtrlCreateLabel("", $temp, 0, 1, $height)

GUICtrlSetState(-1, $GUI_DISABLE)

GUICtrlSetBkColor(-1, "Black")

$temp = $temp + $orgainalTemp

Next

EndFunc ;==>SetColms

Func GetPos($N) ;return the pos of an object

Return ControlGetPos("Shade", "", $All[$N])

EndFunc ;==>GetPos

Func GetWallPos($N) ;return the pos of an object

Return ControlGetPos("Shade", "", $Wall[$N])

EndFunc ;==>GetWallPos

Func SetAll($N, $CreateX, $CreateY, $Color);had problems with it so have not used it

GUICtrlSetPos($All[$N], $CreateX, $CreateY)

GUICtrlSetBkColor($All[$N], $Color)

EndFunc ;==>SetAll

Func CreateAll($N, $CreateX, $CreateY, $Color) ;creates AI or players; also as a side note for some reason this has to do with the 227 problem

$All[$N] = GUICtrlCreateLabel("", FigColms($CreateX), FigRows($CreateY), $HalfColms, $HalfRows);creates stuff

;MsgBox(1,"",$N)

GUICtrlSetBkColor($All[$N], $Color)

EndFunc ;==>CreateAll

Func CreateWall($tempX, $tempY) ;creates walls

$Wall[$WallNumber] = GUICtrlCreateLabel("", $tempX + 1, $tempY + 1, $HalfColms, $HalfRows);creates walls

GUICtrlSetBkColor(-1, "Black")

$WallXY[$WallNumber][0] = $tempX + 1

$WallXY[$WallNumber][1] = $tempY + 1

$WallNumber += 1

;sleep(500)

EndFunc ;==>CreateWall

Func MousePos() ;gets mouse pos

$Target = MouseGetPos()

$Target[0] = $Target[0] - $HalfColms * .5

$Target[1] = $Target[1] - $HalfRows * .5

EndFunc ;==>MousePos

While 1

$msg = GUIGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

Exit

Case $msg = $GUI_EVENT_MINIMIZE

GUISetState(@SW_MINIMIZE)

Case $msg = $GUI_EVENT_MAXIMIZE

GUISetState(@SW_MAXIMIZE)

Case $msg = $GUI_EVENT_RESTORE

GUISetState(@SW_RESTORE)

Case $msg = $TopButton

$Z = 1

Move($AllFocus, 0)

Case $msg = $RightTopButton

$Z = 1

Move($AllFocus, 1)

Case $msg = $RightButton

$Z = 1

Move($AllFocus, 2)

Case $msg = $RightBottomButton

$Z = 1

Move($AllFocus, 3)

Case $msg = $BottomButton

$Z = 1

Move($AllFocus, 4)

Case $msg = $LeftBottomButton

$Z = 1

Move($AllFocus, 5)

Case $msg = $LeftButton

$Z = 1

Move($AllFocus, 6)

Case $msg = $LeftTopButton

$Z = 1

Move($AllFocus, 7)

Case $msg = $CenterButton

$Z = 1

GUICtrlSetPos($All[$AllFocus], FigColms(60), FigRows(60))

Case $msg = $BuildButton

$Z = 1

$Action = 2

ActionPlan()

Case $msg = $HumanButton

$Z = 1

$Action = 3

Case $msg = $DemonButton

$Z = 1

$Action = 4

Case $msg = $DragonButton

$Z = 1

$Action = 5

Case $msg = $BeastButton

$Z = 1

$Action = 6

Case $msg = $AttackButton

$Z = 1

$Action = 7

ActionPlan()

Case $msg = $AIButton

$Z = 1

;$Action = 5

Case $msg = $PlayerButton

$Z = 1

;$Action = 6

Case $msg = $GUI_EVENT_SECONDARYUP

ActionPlan()

Case $msg = $GUI_EVENT_PRIMARYUP

$CursorInfo = GUIGetCursorInfo($Shade)

If $Z = 0 Then ;say if it can act

For $N = 0 To $Total - 1 Step 1

If $CursorInfo[4] = $All[$N] Then ;checks to see if the mouse click clicked on an object

;MsgBox(1, "", "New Focus " & $AllFocus)

$AllFocus = $N

;MsgBox(1, "", "true" & $N)

ElseIf 0 = $CursorInfo[4] Then ;if not then error

If $N = 1 Then

MsgBox(1, "", "Error" & $N)

EndIf

EndIf

Next

EndIf

EndSelect

If 10000 < _Timer_Diff($starttime) Then ; just a fun little thing

ToolTip(_Timer_Diff($starttime))

EndIf

;_MathCheckDiv(

If $LessCode = 0 And 200 < _Timer_Diff($starttime) Then ; makes it move once every 200 mili secs

ToolTip("") ; clears tool tip

$starttime = _Timer_Init();sets timer

$LessCode = 1

For $N = 0 To $Total - 1 Step 1 ;loop to move

If $MoveOnOff[$N] = 1 Then

If $WhileLoopCount[$N] < $MovePlanNumber[$N] Then;checks to see if there are more moves

;MsgBox(1,"","HIT until Loop " & $N)

MoveSetPlan($N)

$WhileLoopCount[$N] += 1 ; the count down the remmaning move

$LessCode = 0

ElseIf $WhileLoopCount[$N] = $MovePlanNumber[$N] Then ;ends moving

;MsgBox(1, "", "End until Loop " & $N)

$MoveOnOff[$N] = 0; stops the moves

$WhileLoopCount[$N] = 0 ; stops the moves

$LessCode = 0 ;sets less code off

EndIf

EndIf

Next

EndIf

WEnd

Link to comment
Share on other sites

OK, I will nudge since you said little. It is nice that you are creating a game.

But, what is it about? I did run your code but looks unknown to me. A few paragraphs explaining this may help to invoke others to join in with your creativity and adventure. :)

Link to comment
Share on other sites

  • 2 weeks later...

It is a basic role-playing game. Would like to add function that add magic to the deal and stats; ATT and DEF. stuff like that.

i would like to help creating a game i am not so good in autoit jet but one thing is sure i have good ideas for a game if we could work that out it is going to be a real hit thats for sure...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...