- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
Include "basic.bmx"
'------------- "FLIES" GAME -----------------;
Graphics 1024, 768,32
SeedRnd MilliSecs()
SetClsColor 255,255,255
';;;GLOBALS & DIMS
Const HPMX#=150
Global FPS#=100, Flies=0, Dih=100,CD#, GAME
Global Dat#[10], GFX:TImage[100],Fnt[100], CC:TImage[100] , Fly_List:TList, obj_list:TList, REC[10]
';;;
obj_list=CreateList() ; fly_list=CreateList()
';;;;; TYPES ;;;
Type Tfly
Field x,y,HP#[3], dX#,dY#,TMR#[4], C#, Ftype,Chance#
Function Create() 'Borning of FLY
fly:tfly=New Tfly; fly.tmr[1]=400; fly.C=255
If Rand(0,18000)<=2000 Then fly.Ftype=1; Else fly.ftype=0 'TYPE OF FLY (MEAT 1 | NORM 0)
fly.x=Rnd(100,700) ; fly.y=Rnd(100,700) ; fly.hp[0]=-1
fly.hp[1]=Rand(30,HPMX) ; ListAddLast ( fly_list,fly ) ; flies:+1
End Function ''''''''''''
Method Kill()
fly=Null;ListRemove(fly_list,fly); fly_list.Remove(Self); flies:-1
End Method
Method Draw() 'Drawing FLY
DrawOval x,y, Abs( hp[0]/hpMX )*100+3, Abs( hp[0]/hpMx )*100+3
End Method ''''''''''''
End Type
'
Type Tobj
Field x,y, eff%,Zoom#, HP#
Function Create() 'NEW OBJECT
obj:tobj=New tobj; obj.eff=GetMouse(); obj.zoom=10
obj.X=MouseX(); obj.Y=MouseY(); obj.HP=40
ListAddLast (obj_list,obj)
End Function ''''''''''
Method Draw()
If eff=1 SetAlpha 0.5; Else; SetAlpha 1
SetBlend alphablend
SetScale (zoom*0.0075,zoom*0.0075);SetColor 255,255,255
DrawImage GFX [eff], X, Y; SetScale(1,1);
SetAlpha 1;SetBlend alphablend
End Method
Method Kill()
obj=Null; ListRemove(obj_list,obj); obj_list.Remove(Self)
End Method
Method CollideWithFlies()
For Local F:Tfly= EachIn fly_list
If f.x>X And f.x<x+ImageWidth(GFX[eff])*0.01*zoom And f.y>Y And f.y<Y+ImageHeight(gfx[eff])*zoom*0.01
Select eff
Case 1 'LKM
If f.hp[1]>5 Then f.HP[1]:-20/FPS 'DiClorPhos
Case 3 'MidKM
If f.ftype=1 Then F.Chance:+1.1/FpS 'MEAT FLIES
Case 2 'RKM
If f.ftype=0 Then F.chance:+0.1/FpS 'NORM FLIES
End Select
EndIf
Next
End Method
End Type
';;;;; END TYPES ;;;;;;;;
LoadMedia()
For Local ii=0 To 10; fnt[ii]= LoadImageFont("Fnt/Comic.ttf",ii*16) ;Next
SetImageFont fnt[0]; dat[0]=100
';;;;Creating 1st fly
Tfly.Create()
';;;
For Local i=1 To 3
MidHandleImage(Gfx[i])
Next
';;;; M A I N C I C L ;;;;;;;;;;;;;;
Repeat
Cls
If Game=1
EachFly()
Effects()
EndIf
. . .
gost 27.12.2015 13:12 # −1
kegdan 27.12.2015 13:32 # −1
Dummy00001 28.12.2015 00:22 # +1
в википедии пишут что на нём были написаны Worms. резко зауважал.
bormand 28.12.2015 00:34 # −1
Dummy00001 28.12.2015 00:47 # −1
F57 25.02.2017 00:13 # 0
Объект выбрасывает сам себя.
barop 25.02.2017 04:39 # 0