AutoHotkey Community

It is currently May 26th, 2012, 2:40 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 29 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: January 26th, 2009, 3:23 pm 
Offline

Joined: October 9th, 2008, 6:04 am
Posts: 180
Location: Finland
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.. :D


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 January 27th, 2009, 5:44 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 26th, 2009, 5:35 pm 
Offline

Joined: March 10th, 2008, 12:55 am
Posts: 1907
Location: Minnesota, USA
very interesting.
nice dialogue system.
I liked it :)

_________________
rawr. be very afraid
*poke*
Note: My name is all lowercase for a reason.
"I think Bigfoot is blurry, that's the problem. It's not the photographer's fault, Bigfoot is blurry. So there's a large, out-of-focus monster roaming the countryside."


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 26th, 2009, 7:55 pm 
Offline

Joined: November 1st, 2007, 10:03 pm
Posts: 885
Very interesting, This has potential maybe levels , and longer? Possibly upgrades and harder to kill bosses


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 26th, 2009, 10:09 pm 
Offline

Joined: November 24th, 2007, 9:07 pm
Posts: 774
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 27th, 2009, 12:23 am 
Offline

Joined: June 28th, 2007, 1:08 am
Posts: 662
This is great :D

Looking forward to more to read/play!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 27th, 2009, 2:07 am 
Offline

Joined: August 2nd, 2008, 12:31 am
Posts: 101
LOL, that's so neat. Good work.

_________________
Woot.

Please read forum etiquette


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 27th, 2009, 2:18 am 
Online
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Nice! :D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 27th, 2009, 4:00 am 
Offline
User avatar

Joined: November 2nd, 2008, 4:23 pm
Posts: 2906
Location: 127.0.0.1
Haha thats really cute. :lol:

_________________
aboutscriptappsscripts
Any code ⇈ above ⇈ requires AutoHotkey_L to run


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 27th, 2009, 5:43 am 
Offline

Joined: October 9th, 2008, 6:04 am
Posts: 180
Location: Finland
Thanks dudes for the kind words.. :D 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!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 27th, 2009, 5:46 am 
Offline
User avatar

Joined: November 2nd, 2008, 4:23 pm
Posts: 2906
Location: 127.0.0.1
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.

_________________
aboutscriptappsscripts
Any code ⇈ above ⇈ requires AutoHotkey_L to run


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 27th, 2009, 6:13 am 
Offline

Joined: October 9th, 2008, 6:04 am
Posts: 180
Location: Finland
@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. :wink: 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. 8)

_________________
was i wrong, it makes me a very sad panda!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 27th, 2009, 1:52 pm 
Offline

Joined: November 1st, 2007, 10:03 pm
Posts: 885
I figured it out


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 27th, 2009, 2:49 pm 
Offline

Joined: October 9th, 2008, 6:04 am
Posts: 180
Location: Finland
@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.. :D

_________________
was i wrong, it makes me a very sad panda!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 27th, 2009, 11:37 pm 
Offline

Joined: August 20th, 2008, 4:25 pm
Posts: 256
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 28th, 2009, 4:43 am 
Offline

Joined: January 1st, 2009, 10:03 am
Posts: 25
LOL that was hilarious. and educational too. i'm learnin while playin games. what now, ma?
hahahhahaa


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 29 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: daonlyfreez, mhe and 11 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group