sanya9411 | Дата: Среда, 19 Октября 2011, 13:56 | Сообщение # 1 |
частый гость
Сейчас нет на сайте
| Graphics3D 640, 480 SetBuffer BackBuffer()
Dim aMap(20,20) Dim aCube(20,20)
Const TypePlayer = 1, TypeWall = 2
Global player=CreateSphere() PositionEntity player,6, 0.1, 5 TurnEntity player,0,0,0 EntityRadius player, 1.5 EntityType player, TypePlayer
cam=CreateCamera(player) light=CreateLight(1)
Global Floortex=LoadTexture("floor.jpg") Floor1=CreatePlane() PositionEntity Floor1,0,-1,0 EntityTexture Floor1, floortex
Global skytex=LoadTexture("ceil.jpg") ceiling=CreatePlane() PositionEntity ceiling,0,1,0 EntityTexture ceiling, skytex TurnEntity ceiling, 0,0,180
mapSize% = 20 filein = ReadFile("level1.map") mapLines = 1
While Not Eof(filein) mapStr$ = ReadLine$( filein ) For i=1 To MapSize aMap(mapLines,i) = Int( Mid(mapStr,i,1 )) Next mapLines = mapLines + 1 Wend CloseFile(filein)
tex = LoadTexture ("tex1.jpg")
For j=1 To mapSize For i=1 To mapSize If aMap(j,i) = 1 aCube(j,i)=CreateCube() EntityTexture aCube(j,i), tex PositionEntity aCube(j,i), i*2, 0, j*2 EntityType aCube(j,i), TypeWall EndIf Next Next
Collisions TypePlayer, TypeWall, 3, 2
While Not KeyDown( 1 )
If KeyDown(200) MoveEntity player, 0, 0, 0.1 If KeyDown(208) MoveEntity player, 0, 0, -0.1 If KeyDown(203) TurnEntity player, 0, 2, 0 If KeyDown(205) TurnEntity player, 0, -2, 0
RenderWorld UpdateWorld Flip Wend End Что тут надо сделать?
|
|
| |