 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Tseik
Joined: 09 Oct 2008 Posts: 180 Location: Finland
|
Posted: Mon Jan 26, 2009 2:23 pm Post subject: The Insane Adventures of The MightyTank |
|
|
Okey, i made a game, or i dont know if its a game or ahk comic or something.. i`ll make it longer when i have some time..
The Insane Adventures of The MightyTank
| Code: | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; The Insane Adventures of The MightyTank
;;;
;;; By Tseik
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
KeyLock = 1
MsgBox,, The Insane Adventures of The MightyTank, Press "OK" to Start
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; GUI
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Gui, Add, Text, x-15 y250 w100 vTykki1, //
Gui, Add, Text, x-20 y260 w100 vTykki2,===
Gui Add, Button, x620 y-23 w70 h22 vTarget, Boss
Gui, Add, Text, x620 y-23 vObj, o
Gui, Add, Progress, x2 y2 h100 vProg Vertical
Gui Add, ListView, x2 y273 w696 h97 grid, Ground |Grass |Mountains |Rocks |Water
Gui, Show, x400 y300 w700 h373, The Insane Adventures of The MightyTank
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Sleep, 1000
Loop, 100
{
Sleep, 50
GuiControlGet, Tykki1, Pos
GuiControlGet, Tykki2, Pos
Tykki1X += 1
Tykki2X += 1
GuiControl, MoveDraw, Tykki1, x%Tykki1X% y250
GuiControl, MoveDraw, Tykki2, x%Tykki2X% y260
}
Loop, 100
{
Sleep, 50
GuiControlGet, Target, Pos
TargetX -= 1
TargetY += 1
GuiControl, MoveDraw, Target, x%TargetX% y%TargetY%
}
;~ Sleep, 100
SetKeyDelay, 100, BossTalk
SetKeyDelay, 100, PlayerTalk
Gui, Add, Edit, x385 y10 w120 h80 vBossTalk
GuiControl, Focus, BossTalk
Send, Hahahahah... i am going to kill you now, biatchh.
Sleep, 2000
GuiControl,, BossTalk,
GuiControl, Hide, BossTalk
Gui, Add, Edit, x95 y150 w120 h80 vPlayerTalk
GuiControl, Focus, PlayerTalk
Send, So u are that mighty AHKGui Button, i tought you'd be bigger... =D LOL!
Sleep, 2000
GuiControl,, PlayerTalk,
GuiControl, Hide, PlayerTalk
GuiControl, Show, BossTalk
GuiControl, Focus, BossTalk
Send, U noob, watch this.
Sleep, 2000
GuiControl, Focus, BossTalk
GuiControl,, BossTalk,
Send, GuiControl,, Boss, w150 h35
Sleep, 2000
BossSizeW = 100
BossSizeH = 22
Loop, 30
{
BossSizeW += 1
BossSizeH += 1
GuiControl, Move, Target, w%BossSizeW% h%BossSizeH%
GuiControl, Show, BossTalk
Sleep, 30
}
Sleep, 500
GuiControl, Focus, BossTalk
GuiControl,, BossTalk,
Send, What u think about me now.. are u scared..
Sleep, 2000
GuiControl,, BossTalk,
GuiControl, Hide, BossTalk
GuiControl, Show, PlayerTalk
GuiControl, Focus, PlayerTalk
Send, Thanks dude, now its easier for me to hit u...
Sleep, 2000
GuiControl,, PlayerTalk,
GuiControl, Hide, PlayerTalk
GuiControl, Show, BossTalk
GuiControl, Focus, BossTalk
Send, Damn, then i have to kill u now...
Sleep, 2000
GuiControl,, BossTalk,
GuiControl, Hide, BossTalk
Sleep, 1000
Gui, Add, Button, x600 y130 w50 h20 vBomb, Bomb!
BombCoordY = 130
Loop
{
Sleep, 10
BombCoordY +=1
GuiControl, MoveDraw, Bomb, x600 y%BombCoordY%
If BombCoordY = 252
Break
}
BombCoordX = 600
BombStop = 0
Loop
{
If BombStop=1
{
GuiControlGet, Bomb, Pos
Sleep, 1000
Loop
{
BombY +=1
GuiControl, MoveDraw, Bomb, x%BombX% y%BombY%
Sleep, 35
If BombY = 500
Break
}
Break
}
Sleep, 10
BombCoordX -=1
GuiControl, MoveDraw, Bomb, x%BombCoordX% y252
GuiControlGet, Tykki2, Pos
If Tykki2X = %BombCoordX%
{
GuiControl, Hide, Bomb
GuiControl, Show, PlayerTalk
GuiControl, Focus, PlayerTalk
Send, POW
Sleep, 1500
GuiControl,, PlayerTalk,
GuiControl, Hide, PlayerTalk
Break
}
}
MsgBox,, Controls, MORE POWER = UP ARROW`nLESS POWER = DOWN ARROW`nMOVE LEFT = LEFT ARROW`nMOVE RIGHT = RIGHT ARROW`nSHOOT = ENTER`n`nPRESS "OK" WHEN READY TO FIGHT!`n
KeyLock = 0
Return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ButtonBomb!:
BombStop = 1
Return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Up::
If KeyLock=1
Return
GuiControl,, Prog, +10
GuiControlGet, Prog
If Prog = 10
Power = 1
Else If Prog = 20
Power = 2
Else If Prog = 30
Power = 3
Else If Prog = 40
Power = 4
Else If Prog = 50
Power = 5
Else If Prog = 60
Power = 6
Else If Prog = 70
Power = 7
Else If Prog = 80
Power = 8
Else If Prog = 90
Power = 9
Else If Prog = 100
Power = 10
Return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Down::
If KeyLock=1
Return
GuiControlGet, Prog
Prog -=10
GuiControl,, Prog, %Prog%
GuiControlGet, Prog
If Prog = 10
Power = 1
Else If Prog = 20
Power = 2
Else If Prog = 30
Power = 3
Else If Prog = 40
Power = 4
Else If Prog = 50
Power = 5
Else If Prog = 60
Power = 6
Else If Prog = 70
Power = 7
Else If Prog = 80
Power = 8
Else If Prog = 90
Power = 9
Else If Prog = 100
Power = 10
Return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Enter::
If KeyLock=1
Return
Hit = 0
Shot = 0
GuiControlGet, Tykki1, Pos
GuiControl, Move, Obj, y%Tykki1Y% x%Tykki1X%
Shot := ParabolaPhysic(Power, "Obj", "Target")
If Shot = 1
{
Sleep, 700
GuiControl, Show, BossTalk
GuiControl, Focus, BossTalk
Send, Noooo... Argghh... I a m y o u r f a t h e r . . . .
Sleep, 1500
GuiControl,, BossTalk,
GuiControl, Hide, BossTalk
HitPhysic("Target")
GuiControl, Show, PlayerTalk
GuiControl, Focus, PlayerTalk
Send, What ever...
Sleep, 2000
GuiControl,, PlayerTalk,
GuiControl, Hide, PlayerTalk
MsgBox,, The End, THE END
ExitApp
}
Return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Left::
If KeyLock=1
Return
GuiControlGet, Tykki1, Pos
GuiControlGet, Tykki2, Pos
Tykki1X -= 1
Tykki2X -= 1
GuiControl, MoveDraw, Tykki1, x%Tykki1X% y250
GuiControl, MoveDraw, Tykki2, x%Tykki2X% y260
Return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Right::
If KeyLock=1
Return
GuiControlGet, Tykki1, Pos
GuiControlGet, Tykki2, Pos
Tykki1X += 1
Tykki2X += 1
GuiControl, MoveDraw, Tykki1, x%Tykki1X% y250
GuiControl, MoveDraw, Tykki2, x%Tykki2X% y260
Return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
GuiClose:
ExitApp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; FUNCTIONS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Use: Parabola move to an object
;; Parameters: Power, Object, Target
;; Example: ParabolaPhysic(4, "Button1", "")
;; Return: 1 = Target hit "" = Target miss
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ParabolaPhysic(Power, Object, Target)
{
Hit=0
GuiControl, Show, %Object%
GuiControlGet, %Object%, Pos
StartCoordX := %Object%X
StartCoordY := %Object%Y
If Target <>
{
GuiControlGet, %Target%, Pos
TargetX := %Target%X
TargetY := %Target%Y
TargetH := %Target%H
TargetW := %Target%W
TargetLenght := TargetW + TargetX
TargetHeight := TargetH + TargetY
}
WinGetTitle, Title, A
WinGetPos,,, WinW, WinH, %Title%
Loop
{
GuiControlGet, %Object%, Pos
DownForceX += 0.02
DownForceY += 0.06
StartCoordX += 1
StartCoordX += %DownForceX%
StartCoordY -= %Power%
StartCoordY += %DownForceY%
Sleep, 15
GuiControl, Move, %Object%, x%StartCoordX% y%StartCoordY%
If Target <>
{
If StartCoordY Between %TargetY% And %TargetHeight%
{
If StartCoordX Between %TargetX% And %TargetLenght%
{
GuiControl, Hide, %Object%
Return 1
Break
}
}
}
If StartCoordY > %WinH%
Break
}
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Use: Vibrate a control and drop it out of a window
;; Parameters: Target control
;; Example: HitPhysic("Button1")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
HitPhysic(Target)
{
GuiControlGet, %Target%, Pos
TargetX := %Target%X
TargetY := %Target%Y
WinGetTitle, Title, A
WinGetPos,,,, WinH, %Title%
Loop, 20
{
Sleep, 20
TargetX := %Target%X
TargetY := %Target%Y
TargetX +=2
TargetY +=2
GuiControl, Move, %Target%, x%TargetX% y%TargetY%
Sleep, 20
TargetX := %Target%X
TargetY := %Target%Y
TargetX -=2
TargetY -=2
GuiControl, Move, %Target%, x%TargetX% y%TargetY%
Sleep, 20
TargetX := %Target%X
TargetY := %Target%Y
TargetX +=2
TargetY -=2
GuiControl, Move, %Target%, x%TargetX% y%TargetY%
Sleep, 20
TargetX := %Target%X
TargetY := %Target%Y
TargetX -=2
TargetY +=2
GuiControl, Move, %Target%, x%TargetX% y%TargetY%
}
Loop
{
TargetY +=1
GuiControl, Move, %Target%, x%TargetX% y%TargetY%
Sleep, 1
If TargetY = %WinH%
{
Return 1
Break
}
}
} |
_________________ was i wrong, it makes me a very sad panda!
Last edited by Tseik on Tue Jan 27, 2009 4:44 am; edited 1 time in total |
|
| Back to top |
|
 |
tidbit
Joined: 09 Mar 2008 Posts: 1807 Location: Minnesota, USA
|
Posted: Mon Jan 26, 2009 4:35 pm Post subject: |
|
|
very interesting.
nice dialogue system.
I liked it  _________________ rawr. be very afraid
*poke*
Note: My name is all lowercase for a reason.
Even monkeys fall from trees. - Japanese proverb |
|
| Back to top |
|
 |
Fry
Joined: 01 Nov 2007 Posts: 885
|
Posted: Mon Jan 26, 2009 6:55 pm Post subject: |
|
|
| Very interesting, This has potential maybe levels , and longer? Possibly upgrades and harder to kill bosses |
|
| Back to top |
|
 |
bmcclure
Joined: 24 Nov 2007 Posts: 774
|
Posted: Mon Jan 26, 2009 9:09 pm Post subject: |
|
|
This is pretty cool. The quirkiness of the whole thing, along with the grammar of the dialog, had me laughing (in a good way).
I definitely think you should continue this concept and turn it into something bigger.
Very nice job! _________________ Ben
My Trac projects
My Wiki
[Broken] - My music |
|
| Back to top |
|
 |
Elesar
Joined: 28 Jun 2007 Posts: 622 Location: Somewhere around 35 12N 101 49W
|
Posted: Mon Jan 26, 2009 11:23 pm Post subject: |
|
|
This is great
Looking forward to more to read/play! |
|
| Back to top |
|
 |
Jex
Joined: 01 Aug 2008 Posts: 101
|
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 8688
|
Posted: Tue Jan 27, 2009 1:18 am Post subject: |
|
|
Nice!  |
|
| Back to top |
|
 |
Frankie
Joined: 02 Nov 2008 Posts: 2850
|
Posted: Tue Jan 27, 2009 3:00 am Post subject: |
|
|
Haha thats really cute.  _________________ aboutscript ⍟ apps ⍟ scripts
Any code ⇈ above ⇈ requires AutoHotkey_L to run |
|
| Back to top |
|
 |
Tseik
Joined: 09 Oct 2008 Posts: 180 Location: Finland
|
Posted: Tue Jan 27, 2009 4:43 am Post subject: |
|
|
Thanks dudes for the kind words.. it boost me up to do more!
What u all think, should it be only comic or also a playable game? _________________ was i wrong, it makes me a very sad panda! |
|
| Back to top |
|
 |
Frankie
Joined: 02 Nov 2008 Posts: 2850
|
Posted: Tue Jan 27, 2009 4:46 am Post subject: |
|
|
I think you should keep this version as the comic version and then create a game thats accualy a game. Nice job on the physics btw. _________________ aboutscript ⍟ apps ⍟ scripts
Any code ⇈ above ⇈ requires AutoHotkey_L to run |
|
| Back to top |
|
 |
Tseik
Joined: 09 Oct 2008 Posts: 180 Location: Finland
|
Posted: Tue Jan 27, 2009 5:13 am Post subject: |
|
|
@Frankie
Yes, the physics was the hardest part, especially parabola movement, its easy to use now.
You can do pranks with it, try it on some button or listview in an ahk gui window. I`ll make separate PhysicsEngine that others could use.
I dont know if anyone figured it out, but u can stop that first bomb, just leftclick the bomb button.  _________________ was i wrong, it makes me a very sad panda! |
|
| Back to top |
|
 |
Fry
Joined: 01 Nov 2007 Posts: 885
|
Posted: Tue Jan 27, 2009 12:52 pm Post subject: |
|
|
| I figured it out |
|
| Back to top |
|
 |
Tseik
Joined: 09 Oct 2008 Posts: 180 Location: Finland
|
Posted: Tue Jan 27, 2009 1:49 pm Post subject: |
|
|
@Fry: good!
Next weekend i might have some time to do more... maybe this time its a bit longer and there is more to play, i hope.
Anyone have a good way to do multitasks? what i want is that i could move the boss same time when tank shoots. Do i have to loop my loops..  _________________ was i wrong, it makes me a very sad panda! |
|
| Back to top |
|
 |
Chavez
Joined: 20 Aug 2008 Posts: 256
|
Posted: Tue Jan 27, 2009 10:37 pm Post subject: |
|
|
I loved the dialog system and the physics were fluent as well. Good job, this makes a good base for other games (say... an engine, even?) _________________ -Chavez. |
|
| Back to top |
|
 |
interms
Joined: 01 Jan 2009 Posts: 25
|
Posted: Wed Jan 28, 2009 3:43 am Post subject: |
|
|
LOL that was hilarious. and educational too. i'm learnin while playin games. what now, ma?
hahahhahaa |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|