Advertisement
pastamaker

ballz v2.1

Jul 2nd, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
  2. ; #Warn  ; Enable warnings to assist with detecting common errors.
  3. SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
  4. SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
  5.  
  6.  
  7.  #Include,<hellbents_gdip>
  8.  
  9.  SetBatchLines,-1
  10.  
  11.  #MaxHotkeysPerInterval,10000000000
  12.  
  13.  popUp:=Layered_Window_SetUp(4,0,0,A_ScreenWidth,A_ScreenHeight,1,"Alwaysontop")
  14.  ;~ back1:=new BackClass(50,50,560,560,50,"0000af","000000",popup)
  15.  ;~ ball1:= New BallClass(350,350,10,"a00000",5,7,0.001,back1)
  16.  
  17.  ;~ ballz1:=new ballz(back1,"00ff00",6,0.001)
  18.  
  19. ;~ ballz1.add(100,100,50,90)
  20.  ;~ ballz1.add(100,100,50,0)
  21.  
  22.  ;~ str:={x:17,y:17,s:20}
  23.  ;~ block1:=new BlockClass(200,200,25,5,"00ff00","ffffff",back1,3,{x:17,y:17,s:20},16)
  24.  blocks1:=New BlockS(16,4,"00ff00","ffffff",back1,4,{x:17,y:17,s:20})
  25.  ;~ blocks1.add(100,100,16,1)
  26.   ;~ blocks1.add(200,200,16,2)
  27.  matrix1:= new Matrix(15,15,BlockS1.w*2 + 2,BlockS1)
  28.  matrix1.setBack(50,50,50,"0000af","000000",popup)
  29.  blocks1.back:=matrix1.back
  30.  matrix1.add(1,1,16)
  31.   matrix1.add(2,0,16)
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  ballz1:=new  ballz(matrix1.back,"00ff00",6,0.0001)
  41.  n:=20
  42.  loop % n {
  43.     Random,angle,30,150
  44.     random,v,10,35
  45.     ballz1.add(400,400,v,angle)
  46. }
  47.  
  48.  launch1:=new Launch(ballz1,matrix1.back)
  49.  launch1.firstTouch:=1
  50.  launch1.lastLaunched:=n
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  tt:=0
  57.  SetTimer,matrixLoop,25
  58. return
  59.  
  60. targetLoop:
  61. loop {
  62.     if(GetKeyState("lbutton") = 0)
  63.         break
  64.     ToolTip,release lbutton
  65. }
  66. ToolTip
  67. loop {
  68.     Gdip_GraphicsClear(popUp.g)
  69.     matrix1.back.draw()
  70.     matrix1.BlockS.draw()
  71.     ballz1.draw()
  72.     massVangle:=launch1.drawArrow(popup.g)
  73.     UpdateLayeredWindow(popUp.hwnd, popUp.hdc, popUp.x, popUp.y, popUp.w, popUp.h)
  74.     if(GetKeyState("lbutton") )
  75.         break
  76. }
  77. return
  78. 8::
  79. SetTimer,matrixLoop,-1
  80. gosub allToTouchLoop
  81. SetTimer,matrixLoop,25
  82. return
  83. allToTouchLoop:
  84. Loop 100 {
  85.     loop % floor(a_index/1.1+1) {
  86.         Launch1.allToTouch()
  87.     }
  88.     Gdip_GraphicsClear(popUp.g)
  89.     matrix1.back.draw()
  90.     matrix1.BlockS.draw()
  91.     ballz1.draw()
  92.  
  93.     UpdateLayeredWindow(popUp.hwnd, popUp.hdc, popUp.x, popUp.y, popUp.w, popUp.h)
  94.     }
  95. return
  96.  
  97. blocksLoop:
  98. Gdip_GraphicsClear(popUp.g)
  99.  
  100.  
  101.  
  102.  
  103. blocks1.draw()
  104. UpdateLayeredWindow(popUp.hwnd, popUp.hdc, popUp.x, popUp.y, popUp.w, popUp.h)
  105. return
  106. loopSmooth:
  107. Gdip_GraphicsClear(popUp.g)
  108. matrix1.back.draw()
  109. matrix1.BlockS.draw()
  110. ballz1.draw()
  111. UpdateLayeredWindow(popUp.hwnd, popUp.hdc, popUp.x, popUp.y, popUp.w, popUp.h)
  112. return
  113. moveBlocksLoop:
  114. loop 25 {
  115.         matrix1.matrixMoveSmooth(25)
  116.         gosub loopSmooth
  117.     }
  118.     matrix1.matrixMove()
  119.     matrix1.ranadd()
  120. return
  121.  
  122. matrixLoop:
  123.  
  124. if(Launch1.lastLaunched =  ballz1.ArroWballz.length()  && Launch1.iflaunch() = 1){
  125.    
  126.     SetTimer,matrixLoop,-1
  127.     gosub moveBlocksLoop
  128.     gosub allToTouchLoop
  129.     gosub targetLoop
  130.     Launch1.lastLaunched:=0
  131.     SetTimer,matrixLoop,25
  132. }
  133. tt++
  134. if(mod(tt,5) = 0)
  135.     launch1.launchEm(massVangle.v,massVangle.angle)
  136. launch1.touch()
  137.  
  138. Gdip_GraphicsClear(popUp.g)
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  matrix1.moveBallz(10,ballz1.ArroWballz)
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154. matrix1.back.draw()
  155. matrix1.BlockS.draw()
  156. ballz1.draw()
  157. UpdateLayeredWindow(popUp.hwnd, popUp.hdc, popUp.x, popUp.y, popUp.w, popUp.h)
  158. return
  159. gameLoop:
  160. ballz1.launch()
  161.  
  162. Gdip_GraphicsClear(popUp.g)
  163. back1.draw()
  164.  
  165. degree:=100
  166. for i,value in ballz1.ArroWballz {
  167.     value.g/=degree
  168.     value.vx/=degree
  169.     value.vy/=degree
  170. }
  171. for i,value in ballz1.ArroWballz {
  172.     loop % degree {
  173.        
  174.         value.move()
  175.         value.bounce()
  176.     }
  177. }
  178. for i,value in ballz1.ArroWballz {
  179.     value.g*=degree
  180.     value.vx*=degree
  181.     value.vy*=degree
  182. }
  183.  
  184. for i,value in ballz1.ArroWballz
  185.     value.draw()
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192. UpdateLayeredWindow(popUp.hwnd, popUp.hdc, popUp.x, popUp.y, popUp.w, popUp.h)
  193. return
  194.  
  195.  class BlockClass {
  196.     __New(x,y,w,r,colourOut,colourIn,back,dr,str,point){
  197.         this.x:=x,this.y:=y,this.r:=r,this.w:=w,this.colourOut:=colourOut,this.colourIn:=colourIn,this.g:=back.g,this.dr:=dr,this.str:=str
  198.         back:=this.back,this.ballz:=[]
  199.        
  200.        
  201.         v:=0,g:=0,angle:=0
  202.        
  203.        
  204.         colour:="I_need_more_hours_with_U"
  205.         x:=this.x - this.w + r , y:=this.y - this.w + r
  206.         this.ballz.insert(new BallClass(X,Y,R,COLOUR,V,ANGLE,G,BACK))
  207.        
  208.         x:=this.x + this.w - r , y:=this.y - this.w + r
  209.         this.ballz.insert(new BallClass(X,Y,R,COLOUR,V,ANGLE,G,BACK))
  210.        
  211.         x:=this.x - this.w + r , y:=this.y + this.w - r
  212.         this.ballz.insert(new BallClass(X,Y,R,COLOUR,V,ANGLE,G,BACK))
  213.        
  214.         x:=this.x + this.w - r , y:=this.y + this.w - r
  215.         this.ballz.insert(new BallClass(X,Y,R,COLOUR,V,ANGLE,G,BACK))
  216.         THIS.POINT:=point
  217.     }
  218.     draw(){
  219.         pBrushIn:=new_brush(this.colourIn), pBrushOut:=new_brush(this.colourOut),   dr:=this.dr
  220.        
  221.         Gdip_FillRoundedRectangle(this.g, pBrushOut, this.x - this.w, this.y -this.w, 2*this.w, 2*this.w , this.r)
  222.         Gdip_FillRoundedRectangle(this.g, pBrushIn, this.x - this.w + dr, this.y -this.w + dr, 2*this.w - 2*dr, 2*this.w -2*dr  , this.r)
  223.         string:="x" this.x - this.str.x " y" this.y - this.str.y   " s"  this.str.s  " cff000000 "
  224.         gdip_TextToGraphics(THIS.g, this.point,String, "Segoe Print")
  225.     }
  226.     bump(ballAttacker){
  227.         if(this.inside(ballAttacker)){
  228.             f1x:=(ballAttacker.x >= this.x - this.w + this.r )
  229.             f2x:=(ballAttacker.x <= this.x + this.w - this.r )
  230.             fx:=(f1x && f2x)
  231.             f1Y:=(ballAttacker.y >= this.y - this.w + this.r )
  232.             f2y:=(ballAttacker.y <= this.y + this.w - this.r )
  233.             fy:=(f1y && f2y)
  234.             if(fx || fy){
  235.                 if(ballAttacker.vx > 0 && fy )
  236.                     ballAttacker.x :=  this.x - this.w  - ballAttacker.r - 1 ,ballAttacker.vx:=-ballAttacker.vx
  237.                 else if(ballAttacker.vx < 0 && fy)
  238.                     ballAttacker.x :=  this.x + this.w  + ballAttacker.r + 1, ballAttacker.vx:=-ballAttacker.vx
  239.                 if(ballAttacker.vy > 0 && fx)
  240.                     ballAttacker.y :=  this.y - this.w  - ballAttacker.r - 1 ,ballAttacker.vy:=-ballAttacker.vy
  241.                 else if(ballAttacker.vy < 0 && fx )
  242.                     ballAttacker.y :=  this.y + this.w  + ballAttacker.r + 1, ballAttacker.vy:=-ballAttacker.vy
  243.             }
  244.             else {
  245.                 loop 4 {
  246.                     ballAttacker.bump(this.ballz[A_Index])
  247.                 }
  248.             }
  249.            
  250.         }
  251.     }
  252.     inside(ball){
  253.         f1x:=(ball.x >= this.x - this.w - ball.r )
  254.         f2x:=(ball.x <= this.x + this.w + ball.r)
  255.         f1y:=(ball.y >= this.y - this.w - ball.r )
  256.         f2y:=(ball.y <= this.y + this.w + ball.r)
  257.         if(f1x && f2x && f1y && f2y)
  258.             return true
  259.         return false
  260.        
  261.     }
  262.    
  263.  
  264. }
  265.  
  266.   class BlockS {
  267.     __New(w,r,colourOut,colourIn,back,dr,str){
  268.         this.r:=r,this.w:=w,this.colourOut:=colourOut,this.colourIn:=colourIn,this.g:=back.g,this.dr:=dr,this.str:=str,this.back:=back
  269.         this.ArrowBlock:=[]
  270.     }
  271.     add(x,y,point,spot){
  272.         this.ArrowBlock[spot]:=new BlockClass(x,y,this.w,this.r,this.colourOut,this.colourIn,this.back,this.dr,this.str,point)
  273.     }
  274.     draw(){
  275.         for i , value in this.ArrowBlock {
  276.             if(value.point > 0)
  277.                 value.draw()
  278.         }
  279.     }
  280.     findSpot(){
  281.         for i , value in this.ArrowBlock {
  282.             if(value.point < 1)
  283.                 return i
  284.         }
  285.         return this.ArrowBlock.length() + 1
  286.     }
  287.     move(step){
  288.         for i , value in this.ArrowBlock {
  289.             value.y+=step
  290.         }
  291.     }
  292. }
  293.  
  294.  class Matrix {
  295.     __New(quaX,quaY,Squa,BlockS){
  296.         this.BlockS:=BlockS
  297.         this.matrix:=[]
  298.         this.Squa:=Squa,    this.quaX:=quaX,    this.quaY:=quaY , quaX+=2 , quaY+=2
  299.         loop % quaY {
  300.             y:=A_Index - 2
  301.             matrix:=[]
  302.             loop % quaY {
  303.                 x:=A_Index - 2
  304.                 matrix[x]:=0
  305.             }
  306.             this.matrix[y]:=matrix.clone()
  307.            
  308.         }
  309.        
  310.     }
  311.     ranadd(){
  312.         loop % this.quaX {
  313.             Random,point,-48,16
  314.             this.add(A_Index - 1,0,point)
  315.         }
  316.     }
  317.     add(xpos,ypos,point){
  318.         spot:=this.BlockS.findSpot()
  319.         x:=xpos*this.Squa + this.back.x1 + this.back.d + this.Squa/2
  320.         y:=ypos*this.Squa + this.back.y1 + this.back.d + this.Squa/2
  321.         this.BlockS.add(x,y,point,spot)
  322.         this.matrix[ypos][xpos]:=this.BlockS.ArrowBlock[spot]
  323.     }
  324.     setBack(X1,Y1,d,COLOURfront,COLOURback,popup){
  325.         this.back:=new BackClass(X1,Y1,X1+2*d + this.quaX*this.Squa,Y1+2*d + this.quaY*this.Squa,d,COLOURfront,COLOURback,popup)
  326.     }
  327.     matrixMoveSmooth(cycle){
  328.         this.BlockS.move(this.squa/cycle)
  329.     }
  330.     matrixMove(){
  331.         quaY:=this.quaY - 1
  332.         t:=quaY
  333.         loop % quaY {
  334.             matrix:=this.matrix[t-1].clone()
  335.             this.matrix[t]:=matrix.clone()
  336.             t--
  337.         }
  338.         for i, value in this.matrix[this.quaY-1] {
  339.             if(value.point > 0  )
  340.                 gosub gameOver
  341.         }
  342.         return
  343.         gameover:
  344.         MsgBox,GAME OVER
  345.         return
  346.     }
  347.     formBlocks( ball    ){
  348.         x:= (ball.x - (this.back.x1  + this.back.d) )//this.Squa
  349.         y:= (ball.y - (this.back.y1  + this.back.d) )//this.Squa
  350.         x:=Floor(x),y:=floor(y)
  351.         ;~ Sleep 50
  352.        
  353.        
  354.         blocks:=[]
  355.         x--
  356.         y--
  357.         x0:=x
  358.         y0:=y
  359.         loop 3 {
  360.             x:=x0
  361.             loop 3 {
  362.                
  363.            
  364.                 if(this.matrix[y][x].point > 0)
  365.                     blocks.Insert(this.matrix[y][x])
  366.                     ;~ MsgBox
  367.                
  368.                    
  369.                 x++
  370.             }
  371.             y++
  372.         }
  373.         ;~ if( blocks.length() <> 0 )
  374.             ;~ MsgBox
  375.         return blocks
  376.     }
  377.     moveBallz(tacts,ballz){
  378.         for i,value in ballz
  379.             value.vx/=tacts,    value.vy/=tacts,    value.g/=tacts
  380.         loop % tacts {
  381.             for i,value in ballz
  382.                 value.move()
  383.            
  384.             for i,value in ballz {
  385.                 blocks:=this.formBlocks(value)
  386.                
  387.                 for j,block in blocks {
  388.                     tvx:=value.vx, tvy:=value.vy
  389.                     block.bump(value)
  390.                     if(tvx <> value.vx || tvy <> value.vy)
  391.                         block.point--
  392.                 }
  393.                
  394.             }
  395.             for i,value in ballz
  396.                 value.bounce()
  397.            
  398.         }
  399.        
  400.        
  401.         for i,value in ballz
  402.             value.vx*=tacts,    value.vy*=tacts,    value.g*=tacts
  403.        
  404.        
  405.        
  406.     }
  407. }
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  class BallClass {
  442.     __New(X,Y,R,COLOUR,v,ANGLE,G,BACK){
  443.         this.x:=x,this.y:=y,this.r:=r,this.colour:=colour,this.vx:=v*cosg(angle),this.vy:=v*sing(angle),this.angle:=angle,this.g:=g,this.back:=back
  444.     }
  445.     move(){
  446.         if(this.vx = this.vy && this.vy = 0)
  447.             return
  448.         this.vy+=this.g,    this.y+=this.vy,    this.x+=this.vx
  449.     }
  450.     draw(){
  451.         Fill_ellipse(this.back.g,this.colour,this.x - this.r,this.y - this.r,2*this.r,2*this.r)
  452.     }
  453.     bounce(){
  454.        
  455.         if(this.x <= this.back.x1 +this.back.d + this.r)
  456.             this.x:=this.back.x1 +this.back.d + this.r + 1, this.vx:= - this.vx
  457.         else if(this.x >= this.back.x2 - this.back.d - this.r)
  458.             this.x:=this.back.x2 - this.back.d - this.r - 1,    this.vx:= - this.vx
  459.        
  460.         if(this.y <= this.back.y1 +this.back.d + this.r)
  461.             this.y:=this.back.y1 +this.back.d + this.r + 1, this.vy:= - this.vy
  462.         else if(this.y >= this.back.y2 - this.back.d - this.r)
  463.             this.y:=this.back.y2 - this.back.d - this.r -1 ,this.vy:=0,  this.vx:=0
  464.        
  465.        
  466.     }
  467.     bump(ballDefender){
  468.         ballAttacker:=this
  469.         ball1:=ballAttacker, ball2:=ballDefender
  470.         distMin:=ball1.r + ball2.r
  471.         dist:=sqrt((ball2.x - ball1.x)**2 +  (ball2.y - ball1.y)**2)
  472.         if(dist <= distMin){
  473.             v:=Sqrt(ball1.vx**2 + ball1.vy**2)
  474.             angleCentre:=getAngle(ball2.x - ball1.x,ball2.y - ball1.y)
  475.             angleSpeed:=getAngle(ball1.vx, ball1.vy)
  476.             brandNewAngle:= 180 + 2*angleCentre - angleSpeed
  477.             ball1.angle:=brandNewAngle
  478.             ball1.vx:=v*cosg(brandNewAngle)
  479.             ball1.vy:=v*sing(brandNewAngle)
  480.             ball1.x:=ball2.x + (distMin + 1)*cosg(180 + angleCentre)
  481.             ball1.y:=ball2.y + (distMin + 1)*sing(180 + angleCentre)
  482.            
  483.         }
  484.     }
  485.  
  486. }
  487. class Launch {
  488.     __New(ballz,back){
  489.         this.ballz:=ballz,  this.back := back
  490.         this.y0:=back.y2 - back.d
  491.         this.Firsttouch:=0
  492.         this.lastLaunched:=0
  493.         this.lauchEnded := 1
  494.     }
  495.     touch(){
  496.         if( this.Firsttouch <> 0)
  497.             return
  498.         for i,value in this.ballz.ArroWballz {
  499.             if(i > this.lastLaunched)
  500.                 break
  501.             if(value.vx = 0 && value.vy = 0){
  502.                 this.Firsttouch := i
  503.                 break
  504.             }
  505.                
  506.         }
  507.     }
  508.     drawArrow(g){
  509.         MouseGetPos,x,y
  510.         x0:=this.ballz.ArroWballz[this.Firsttouch].x
  511.         y0:=this.y0
  512.         x2:=x0-x,   y2:=-abs(y0-y)
  513.         if(y0-y > 0 )
  514.             x2:=-x2
  515.         long:=Sqrt(x2**2+y2**2)
  516.         longMIN:=150
  517.         longMax:=450
  518.         loop:=3
  519.         longMIN/=loop
  520.         longMax/=loop
  521.         if(long < longMIN )
  522.             x2:=x2*(longMIN/long),  y2:=y2*(longMIN/long)
  523.         else if (long > longMax)
  524.                 x2:=x2*(longMax/long),  y2:=y2*(longMax/long)
  525.         long:=Sqrt(x2**2+y2**2)
  526.         dS:=5
  527.         dR:=6
  528.        
  529.         loop % dS {
  530.             x:=A_Index*loop*x2/ds + x0 - dr/2
  531.             y:=A_Index*loop*y2/ds + y0 - dr/2
  532.             fill_ellipse(g,"ffffff",x,y,dr,dr)
  533.         }
  534.         angle:=getangle(x2,y2)
  535.         v:=long/9
  536.         Vangle:={v:v,angle:angle}
  537.         return Vangle.clone()
  538.     }
  539.     allToTouch(){
  540.        
  541.         for i,value in this.ballz.ArroWballz {
  542.            
  543.             if(i > this.lastLaunched)
  544.                 break
  545.            
  546.             if(value.vx = 0 && value.vy = 0){
  547.                 if(abs(value.x - this.ballz.ArroWballz[this.Firsttouch].x) <= 1)
  548.                     value.x:=this.ballz.ArroWballz[this.Firsttouch].x
  549.                 else {
  550.                     if(value.x > this.ballz.ArroWballz[this.Firsttouch].x)
  551.                         value.x--
  552.                     else
  553.                         value.x++
  554.                 }
  555.             }
  556.         }
  557.     }
  558.     iflaunch(){
  559.         speed:=0
  560.         for i , value in this.ballz.ArroWballz
  561.             speed+=abs(value.vx) + abs(value.vy)
  562.         if(speed = 0){
  563.             return true
  564.         }
  565.         return false
  566.        
  567.     }
  568.     launchEm(v,angle){
  569.         if(this.lastLaunched = this.ballz.ArroWballz.length()){
  570.             this.lauchEnded := 1
  571.             return
  572.         }
  573.         if(this.lauchEnded = 1){
  574.             this.lauchEnded := 0
  575.             this.Firsttouch:=0
  576.             this.lastLaunched:=0
  577.         }
  578.         else {
  579.             this.lastLaunched++
  580.             this.ballz.ArroWballz[this.lastLaunched].vx:=v*cosg(angle),this.ballz.ArroWballz[this.lastLaunched].vy:=v*sing(angle)
  581.             this.ballz.ArroWballz[this.lastLaunched].angle:=angle
  582.         }
  583.        
  584.        
  585.     }
  586. }
  587. class ballz {
  588.     __New(back,COLOUR,r,g){
  589.         this.ArroWballz:=[]
  590.         this.back:=back,this.colour:=colour,this.g:=g,this.r:=r
  591.        
  592.     }
  593.     add(x,y,v,angle){
  594.         this.ArroWballz.insert(new BallClass(X,Y,this.R,this.COLOUR,v,ANGLE,this.G,this.BACK))
  595.     }
  596.     move(){
  597.         for i , value in this.ArroWballz
  598.             value.move()
  599.     }
  600.     draw(){
  601.         for i , value in this.ArroWballz
  602.             value.draw()
  603.     }
  604.     bounce(){
  605.         for i , value in this.ArroWballz
  606.             value.bounce()
  607.     }
  608.     bump(ballDefender){
  609.         for i , value in this.ArroWballz
  610.             value.bump(ballDefender)
  611.     }
  612.    
  613. }
  614.  class BackClass {
  615.     __New(X1,Y1,X2,Y2,d,COLOURfront,COLOURback,popup){
  616.         this.x1:=x1,this.x2:=x2,this.y1:=y1,this.y2:=y2,this.d:=d,this.colourfront:=colourfront,this.colourback:=colourback,this.g:=popup.g
  617.         this.brush1:=new_brush("ff0000"),this.brush2:=new_brush("00f0f0")
  618.     }
  619.     draw(){
  620.         w:=this.x2 - this.x1 + 1 - 2*this.d
  621.        
  622.         fill_boxX(this.g,this.colourfront,this.x1,this.y1,this.x2 - this.x1 + 1 , this.y2 - this.y1 + 1 + this.d*4)
  623.         fill_boxX(this.g,this.colourback,this.x1 + this.d , this.y1 + this.d, this.x2 - this.x1 + 1 - 2*this.d , this.y2 - this.y1 + 1 - 2*this.d)
  624.         ;~ Gdip_FillPie(this.g, this.brush1, this.x1 + this.d , this.y2 - w/2 - this.d , w, w, 0, 180)
  625.  
  626.     }
  627. }
  628.  getAngle(dx,dy){
  629.     r:=Sqrt(dx**2 + dy**2)
  630.     if(dx>=0)
  631.         angle:= asinG(dy/r)
  632.     else if(dy>=0)
  633.         angle:= acosG(dx/r)
  634.     else if(dx < 0 && dy < 0)
  635.         angle:= 180 + asing(abs(dy/r))
  636.     while(angle < 0)
  637.         angle+=360
  638.     return angle
  639. }
  640. x::
  641. gosub getOutOfHere
  642. return
  643.  
  644. getOutOfHere:
  645. ExitApp
  646. Layered_Window_ShutDown(popUp)
  647. return
  648. 1::
  649. SetTimer,gameLoop,0
  650. return
  651. 2::
  652. SetTimer,gameLoop,17
  653. return
  654. 3::
  655. SetTimer,gameLoop,170
  656. return
  657. 4::
  658. SetTimer,gameLoop,500
  659. return
  660. 5::
  661. SetTimer,gameLoop,1250
  662. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement