Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #SingleInstance,force
- SetBatchLines,-1
- #Include,<hellbents_gdip>
- popUp:=Layered_Window_SetUp(4,550,50,450,650,1,"+alwaysontop")
- Fill_Boxx(pGraphics,colour,x,y,w,h)
- fill_boxX(popUp.g,"000000",0,0,popUp.w,popUp.h)
- border:=new Outline
- border.set(10,410,10,600,15,25,15,5,"f00000","a00000")
- border.draw(popUp)
- jumpOnMe:=[]
- onWhatTojump :=new Bars
- ;~ onWhatTojump.add(jumpOnMe,100,250,450,75,25,10,"000000")
- onWhatTojump.draw(popUp,jumpOnMe)
- onWhatTojump.random:=0
- ;nochotoy
- manual:=1
- toyMap:=Gdip_CreateBitmapFromFile("new.png")
- Gdip_GetImageDimensions(toyMap, w, h)
- toySize:={w:w,h:h}
- if( manual <> 1){
- toySize:={w:25,h:50}
- toyMap := Gdip_CreateBitmap(toySize.w, toySize.h)
- toyG := Gdip_GraphicsFromImage(toyMap)
- Gdip_SetSmoothingMode(toyG, 4)
- fill_boxX(toyG,"0000ff",0,0,toySize.w,toySize.h/2)
- fill_boxX(toyG,"00ff00",0,toySize.h/2,toySize.w,toySize.h/2)
- }
- bearToy:=new Nochotoy
- bearToy.set((border.wx1+border.wx2)//2,border.wy1+toySize.h,3,0.04,13,toyMap,border)
- ;end nochotoy
- UpdateLayeredWindow(popUp.hwnd, popUp.hdc, popUp.x, popUp.y, popUp.w, popUp.h)
- loop {
- ToolTip,% beartoy.g
- Sleep 50
- ;~ randomx(Me,Outline,w1,w2,h,v,colour){
- if(onWhatTojump.random < 0){
- onWhatTojump.randomx(5,7,jumpOnMe,border,100,150,10,2,colourGenerator())
- }
- border.draw(popUp)
- ;~ bearToy.onWhatTojump.somewhere(bearToy,jumpOnMe)
- onWhatTojump.move(jumpOnMe)
- onWhatTojump.draw(popUp,jumpOnMe)
- bearToy.move(jumpOnMe,onWhatTojump)
- bearToy.draw(popUp)
- UpdateLayeredWindow(popUp.hwnd, popUp.hdc)
- onWhatTojump.somewhere(bearToy,jumpOnMe)
- bearToy.accident()
- }
- class Outline{
- set(x1,x2,y1,y2,wx1,wx2,wy1,wy2,colourBack,colourLine){
- This.x1:=x1
- This.x2:=x2
- This.y1:=y1
- This.y2:=y2
- This.wx1:= wx1+x1
- This.wx2:= -wx2+x2
- This.wy1:= wy1+y1
- This.wy2:= -wy2+y2
- this.colourBack:=colourBack
- this.colourLine:=colourLine
- }
- draw(popUp){
- fill_boxX(popUp.g,this.colourLine,this.x1,this.y1,this.x2-this.x1,this.y2-this.y1)
- fill_boxX(popUp.g,this.colourBack,this.wx1,this.wy1,this.wx2-this.wx1,this.wy2-this.wy1)
- }
- }
- Class Bar{
- set(x1,x2,y1,ymin,h,v,colour){
- This.x1:=x1
- This.x2:=x2
- This.y1:=y1
- This.ymin:=ymin
- This.h:=h
- This.v:=v
- This.colour:=colour
- this.deleteme:=0
- }
- undeR(x,y,w){
- if( x > this.x1 - w and x < this.x2 and y > this.y1)
- return true
- return false
- }
- abovE(x,y,w){
- if( x > this.x1 - w and x < this.x2 and y < this.y1)
- return true
- return false
- }
- wasAboveButNowUnderQ(x,y1,y2,w){
- if(this.abovE(x,y1,w) and this.undeR(x,y2,w)){
- return true
- }
- return false
- }
- draw(popUp){
- what:=2
- fill_boxX(popUp.g,"000000",this.x1-what,this.y1-what,this.x2 - this.x1+what,this.h+what)
- fill_boxX(popUp.g,this.colour,this.x1,this.y1,this.x2 - this.x1,this.h)
- ;~ fill_boxX(popUp.g,"ffffff",0,0,250,250)
- }
- move(){
- This.y1+=THIS.V
- this.delete()
- }
- delete(){
- if(this.y1 + this.h > this.ymin )
- this.deleteme:=1
- }
- here(toy){
- x1:=toy.x1
- x2:=toy.x2
- y2:=toy.y2
- dHuP:=2
- dHdowN:=5
- ;~ ToolTip,% x2 " > " this.x1 " and" x1 " < " this.x2 " and" y2 " > " this.y1 - dHuP " and" y2 " < " this.y1 + dHdowN
- ;~ Sleep 2000
- if(x2 > this.x1 and x1 < this.x2 and y2 > this.y1 - dHuP and y2 < this.y1 + dHdowN ){
- return true
- }
- return false
- }
- }
- class Bars {
- draw(popUp,Me){
- for i,value in me {
- value.draw(popUp)
- }
- }
- somewhere(toy,me){
- if(toy.g <> 0 )
- return true
- for i,value in me {
- if(value.here(toy))
- return true
- }
- toy.g:= 1
- return false
- }
- wherecollisionIs(me,x,y1,y2,w){
- for i,value in me {
- if(value.wasAboveButNowUnderQ(x,y1,y2,w))
- return i
- }
- return 0
- }
- delete(Me){
- t:=0
- while(me.length() > t ){
- t++
- if(me[t].deleteme = 1)
- me.Remove(t)
- }
- }
- add(Lim1,lim2,Me,x1,x2,y1,ymin,h,v,colour){
- random,ran,lim1,lim2
- this.random:= ran*h // v
- that:= new Bar
- that.set(x1,x2,y1,ymin,h,v,colour)
- me.insert(that)
- }
- move(me){
- this.random--
- for i,value in me
- value.move()
- this.delete(Me)
- }
- randomx(lim1,lim2,Me,Outline,w1,w2,h,v,colour){
- random,ran,w1,w2
- x1:=Outline.wx1
- x2:=Outline.wx2
- random,x1,x1,x2 - ran
- y1:=Outline.wy1
- ymin:=Outline.wy2
- this.add(lim1,lim2,Me,x1,x1+ran,y1,ymin,h,v,colour)
- }
- }
- colourGenerator(){
- a:=[]
- a:=["1","2","3","4","5","6","7","8","9","a","b","c","d","f"]
- colour=00
- loop 4 {
- Random,ran,1,15
- new:=a[ran]
- colour=%colour%%new%
- }
- return colour
- }
- Class NoChoToy {
- set(x,y,stepx,stepy,DefLeap,map,border){
- This.map:=map
- Gdip_GetImageDimensions(map, w, h)
- This.x1:=x
- This.x2:=x+w
- This.y1:=y-h
- This.y2:=y
- This.vy:=0
- This.W:=w
- This.H:=h
- This.G:= 1
- This.stepy:=stepy
- This.stepx:=stepx
- This.leap:=1
- this.defleap:=defLeap*defLeap
- this.border:=Border
- this.go:=0
- }
- moveX(){
- keyLeft:=GetKeyState("a")
- keyRight:=GetKeyState("d")
- if(keyLeft){
- This.x1-=this.stepx
- This.x2-=this.stepx
- }
- else if(keyRight){
- This.x1+=this.stepx
- This.x2+=this.stepx
- }
- if(this.x1 < this.border.wx1){
- this.x1:=this.border.wx1
- this.x2:=this.border.wx1 + this.w
- }
- else if(this.x2 > this.border.wx2){
- this.x1:=this.border.wx2 - this.w
- this.x2:=this.border.wx2
- }
- }
- directionYOK(){
- if(this.g = -1 and this.leap = 1)
- this.g:=1
- this.y1+= this.g*this.stepy*this.leap + this.vy
- this.y2:=this.y1+this.h
- this.leap+=this.g*2
- }
- directionYSTOP(bar){
- ;~ this.y1:=bar.y1 + bar.v
- ;~ this.y2:=this.y1 + this.h
- this.vy:=bar.v
- this.g:=0
- this.leap:=1
- }
- jumPY(){
- keyUp:=GetKeyState("w")
- if(keyUp and this.g = 0){
- this.leap:=this.deFLeap
- this.g:=-1
- }
- }
- moveY(me,bars){
- this.jumPY()
- x:=this.x1
- y1:=this.y2
- y2:=this.y2 + this.stepy*this.leap*this.g
- collision:=bars.wherecollisionIs(me,x,y1,y2,this.w)
- if(collision = 0){
- this.directionYOK()
- }
- else {
- this.directionYSTOP(me[collision])
- }
- }
- move(me,bars){
- key:=GetKeyState("s")
- if(key)
- this.go:=1
- if(this.go){
- this.moveY(me,bars)
- this.moveX()
- }
- }
- accident(){
- if((this.y1 < this.border.wy1) or (this.y2 > this.border.wy2)){
- SoundBeep
- Sleep 1000
- gui,1:hide
- MsgBox,,,accident happened reload after 2 sec,2
- Reload
- }
- }
- draw(popUp){
- Gdip_DrawImage(popUp.g, this.map, this.x1,this.y1, this.w, this.h)
- }
- }
- a::
- return
- s::
- return
- d::
- return
- w::
- return
- x::
- Layered_Window_ShutDown(popUp)
- ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement