Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SuperStrict
- Framework brl.glmax2d
- Import brl.font
- Import brl.freetypefont
- Import brl.basic
- Import brl.pngloader
- Import brl.random
- Include "globals.bmx"
- Include "player.bmx"
- Include "mob.bmx"
- Include "blood.bmx"
- Include "bullet.bmx"
- Type TEntity
- Global list:TList = New TList
- Field x:Float, y:Float, ang:Float, frame:Int
- Field img:TImage, shadow:TImage, alpha:Float
- Field life:Int
- Field speed:Float
- End Type
- AppTitle = "Excellent Meat v0.1"
- Graphics (g_width, g_height, 0)
- SetBlend (ALPHABLEND)
- Global font:TImageFont = LoadImageFont ("fonts\xirod.ttf", 13)
- SetImageFont (font)
- Global map_image:TImage = LoadImage ("gfx\tile_grass.png")
- AutoMidHandle True
- Global img_blood1:TImage = LoadImage ("gfx\blood1.png")
- Global img_blood2:TImage = LoadImage ("gfx\blood2.png")
- Global img_blood3:TImage = LoadImage ("gfx\blood3.png")
- Global mob_image:TImage = LoadAnimImage ("gfx\monster.png", 40, 20, 0, 20)
- Global img_shadow:TImage = LoadImage ("gfx\player_shadow.png")
- Global img_bullet:TImage = LoadImage ("gfx\bullet.png")
- AutoMidHandle False
- Global player_image:TImage = LoadAnimImage ("gfx\player.png", 68, 40, 0, 8)
- SetImageHandle player_image, ImageWidth (player_image) / 3, ImageHeight (player_image) / 2
- Global heart_image:TImage = LoadImage ("gfx\heart.png")
- Global mp5_image:TImage = LoadImage ("gfx\mp5.png")
- Global shotgun_image:TImage = LoadImage ("gfx\shotgun.png")
- TPlayer.Create (player_image, img_shadow, g_width / 2, g_height / 2)
- While Not KeyHit (KEY_ESCAPE)
- SetColor 255, 255, 255
- SetRotation 0.0
- SetAlpha 1.0
- SetScale 1.0, 1.0
- For Local x:Int = 0 Until map_width
- For Local y:Int = 0 Until map_height
- If map_image Then DrawImage map_image, (x * ImageWidth (map_image)) - CameraX, (y * ImageHeight (map_image)) - CameraY
- Next
- Next
- For Local b:TBlood = EachIn TBlood.List
- b.Update
- b.Draw
- Next
- For Local m:TMob = EachIn TMob.List
- m.Update
- m.Draw
- Next
- For Local b:TBullet = EachIn TBullet.List
- b.Update
- b.Draw
- Next
- For Local p:TPlayer = EachIn TPlayer.List
- p.Update
- p.Draw
- Next
- DrawText "Score: " + player_score, 0, 0
- If time_create < MilliSecs () Then
- time_create = MilliSecs () + (1500 - time_subtract_spawn)
- Local pos:Int = Rand (1, 4)
- Select pos
- Case 1 ;TMob.Create (mob_image, img_shadow, player.x - 50, Rand (g_height))
- Case 2 ;TMob.Create (mob_image, img_shadow, g_width + 50, Rand (g_height))
- Case 3 ;TMob.Create (mob_image, img_shadow, Rand (g_width), -50)
- Case 4 ;TMob.Create (mob_image, img_shadow, Rand (g_width), g_height + 50)
- End Select
- End If
- Flip
- Cls ()
- GCCollect ()
- Wend
- Function GetAngle:Double (x0:Double, y0:Double, x1:Double, y1:Double)
- Return ATan2 (y1 - y0, x1 - x0)
- End Function
Add Comment
Please, Sign In to add comment