Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- screenw = 640
- screenh = 480
- SCREEN screenw, screenh
- fov# = 60.0
- fovp2# = fov/2.0
- fovpl# = fov/Float(screenw)
- screenhp2 = screenh/2.0
- Const detail = 4
- map = LoadMap("media\cdm2.til", "media\tileset.bmp")
- asd = MakeObject()
- ObjectRange asd, 10
- ObjectPickable map, ON
- SetupCollision asd, map, 1, 4, 2
- Repeat
- DrawGame
- MoveObject asd, 4*(KeyDown(200)-KeyDown(208))
- TurnObject asd, 4*(KeyDown(205)-KeyDown(203))
- Cls
- angle# = -fovp2
- TurnObject asd, -fovp2
- Lock
- For i = 0 To screenw-1 Step detail
- ObjectPick asd
- d# = 10*screenh/Distance(ObjectX(asd), ObjectY(asd), PickedX(), PickedY())/Cos(Abs(angle))
- c = Min(200, Max(0, 10+(d-10)*4))
- If(c>0) Then
- Color c, c, c
- For p = i To i+detail-1
- Line p, screenhp2-d, p, screenhp2+d
- Next p
- EndIf
- TurnObject asd, fovpl*detail
- angle = angle + fovpl*detail
- Next i
- Unlock
- TurnObject asd, -fovp2
- DrawScreen
- Forever
- remstart
- til = LoadImage("media\tileset.bmp")
- tilesize = 32
- tilimgw = RoundDown(ImageWidth(til)/tilesize)
- tilimgh = RoundDown(ImageHeight(til)/tilesize)
- Dim tiles(tilimgw*tilimgh-1)
- tilei = 0
- tiledetail = 48
- screenw = 640
- screenh = 480
- For i = 0 To tilimgw-1
- For j = 0 To tilimgh-1
- tiles(tilei) = MakeImage(tilesize*tiledetail, screenh)
- CopyBox i*tilesize, j*tilesize, tilesize, tilesize, 0, (screenh-tilesize)/2, Image(til), Image(tiles(tilei))
- DrawImage tiles(tilei), 0, 0
- drawscreen
- tilei = tilei + 1
- Next j
- Next i
- remend
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement