Added tank textures
This commit is contained in:
parent
08762ddc9a
commit
5951108c0a
6 changed files with 2258 additions and 1601 deletions
BIN
model/tank.blend
BIN
model/tank.blend
Binary file not shown.
3845
model/tank.obj
3845
model/tank.obj
File diff suppressed because it is too large
Load diff
|
@ -27,7 +27,8 @@ import Data.Obj3D.GL
|
|||
main :: IO ()
|
||||
main = do
|
||||
let theLevel = testLevel
|
||||
--hwiidPlayer <- newHWiidPlayer
|
||||
--humanPlayer <- newHWiidPlayer
|
||||
let humanPlayer = DefaultPlayer S.empty 0 0 False
|
||||
gl <- initGL $ glxDriver (levelWidth theLevel) (levelHeight theLevel)
|
||||
|
||||
when (initialized gl) $ do
|
||||
|
@ -36,8 +37,7 @@ main = do
|
|||
, Tank 5.0 3.5 0 0 1.5 270 False 3 1 5 1
|
||||
], bullets = []}
|
||||
mainstate = MainState {run = True, driver = SomeDriver gl, time = currentTime, players =
|
||||
[ SomePlayer $ DefaultPlayer S.empty 0 0 False
|
||||
--SomePlayer $ hwiidPlayer
|
||||
[ SomePlayer humanPlayer
|
||||
, SomePlayer $ CPUPlayer 0
|
||||
], textures = M.empty, models = M.empty, gameState = gamestate}
|
||||
|
||||
|
|
|
@ -139,8 +139,6 @@ render = do
|
|||
texCoord $ TexCoord2 0 (lh/2)
|
||||
vertex $ Vertex2 (0 :: GLfloat) (0 :: GLfloat)
|
||||
|
||||
texture Texture2D $= Disabled
|
||||
|
||||
bindInterleavedArrays modelTank
|
||||
|
||||
forM_ tanklist $ \tank -> unsafePreservingMatrix $ do
|
||||
|
@ -152,7 +150,7 @@ render = do
|
|||
translate $ Vector3 x y (0 :: GLfloat)
|
||||
rotate rotDir $ Vector3 0 0 (1 :: GLfloat)
|
||||
|
||||
--textureBinding Texture2D $= Just textureTank
|
||||
textureBinding Texture2D $= Just textureTank
|
||||
|
||||
unsafePreservingMatrix $ do
|
||||
rotate 90 $ Vector3 1 0 (0 :: GLfloat)
|
||||
|
@ -160,14 +158,12 @@ render = do
|
|||
|
||||
rotate (rotAim-rotDir) $ Vector3 0 0 (1 :: GLfloat)
|
||||
|
||||
--textureBinding Texture2D $= Just textureCannon
|
||||
textureBinding Texture2D $= Just textureCannon
|
||||
|
||||
unsafePreservingMatrix $ do
|
||||
rotate 90 $ Vector3 1 0 (0 :: GLfloat)
|
||||
drawObject modelTank 0
|
||||
|
||||
texture Texture2D $= Enabled
|
||||
|
||||
forM_ bulletlist $ \bullet -> unsafePreservingMatrix $ do
|
||||
let x = realToFrac . bulletX $ bullet
|
||||
y = realToFrac . bulletY $ bullet
|
||||
|
|
BIN
tex/Cannon.png
BIN
tex/Cannon.png
Binary file not shown.
Before Width: | Height: | Size: 581 B After Width: | Height: | Size: 33 KiB |
BIN
tex/Tank.png
BIN
tex/Tank.png
Binary file not shown.
Before Width: | Height: | Size: 288 B After Width: | Height: | Size: 2.2 KiB |
Reference in a new issue