we have a player!

This commit is contained in:
nek0 2020-12-23 16:39:45 +01:00
parent 99f37fc6b2
commit 675b0ff155
4 changed files with 16 additions and 15 deletions

View file

@ -12,6 +12,7 @@ void main()
{
//vec4 texColor = texture(u_texture, v_texCoord);
int index = int(v_texIndex);
color = texture(u_textures[index], v_texCoord);
//color = texture(u_textures[index], v_texCoord);
color = texture(u_textures[index], v_texCoord) * v_color;
//color = vec4(0.0, 1.0, 0.0, 1.0);
}

View file

@ -104,14 +104,14 @@ instance Scene Test where
shader
"u_textures"
(map
((\(GL.TextureObject o) -> o) . textureId)
textureSlot
[ (tileMapTexture $ mapTileMap loadedMap)
, tex
]
)
let pituicat = Pituicat
(V2 0 (-1748))
(V2 400 1748)
(V2 0 0)
(V2 0 0)
100
@ -242,19 +242,19 @@ populate layers props actors =
actorsHere
(lisRaw, lvs) = toVertices l
lis = V.map
(+ if null is then 0 else V.maximum is)
(+ if null is then 0 else V.maximum is + 1)
lisRaw
pis = V.map
(+
if null (is V.++ lis)
then 0
else V.maximum (is V.++ lis))
else V.maximum (is V.++ lis) + 1)
pisRaw
cis = V.map
(+
if null (is V.++ lis V.++ pis)
then 0
else V.maximum (is V.++ lis V.++ pis))
else V.maximum (is V.++ lis V.++ pis) + 1)
cisRaw
in
( is V.++ lis V.++ pis V.++ cis

View file

@ -52,22 +52,22 @@ instance Drawable Tile where
, V.fromList
[ newVertex
(V3 (fromIntegral x * 32) (fromIntegral y * 32) 0)
(V4 0 0 0 1)
(V4 1 1 1 1)
(V2 u1 v1)
0
, newVertex
(V3 (fromIntegral (x + 1) * 32) (fromIntegral y * 32) 0)
(V4 0 0 0 1)
(V4 1 1 1 1)
(V2 u2 v1)
0
, newVertex
(V3 (fromIntegral (x + 1) * 32) (fromIntegral (y + 1) * 32) 0)
(V4 0 0 0 1)
(V4 1 1 1 1)
(V2 u2 v2)
0
, newVertex
(V3 (fromIntegral x * 32) (fromIntegral (y + 1) * 32) 0)
(V4 0 0 0 1)
(V4 1 1 1 1)
(V2 u1 v2)
0
]

View file

@ -30,23 +30,23 @@ instance Drawable Pituicat where
, V.fromList
[ newVertex
(V3 (realToFrac x - 25) (realToFrac y - 25) 0)
(V4 0 0 0 1)
(V4 0 1 0 1)
(V2 0 (1 - 50 / 1024))
1
, newVertex
(V3 (realToFrac x + 25) (realToFrac y - 25) 0)
(V4 0 0 0 1)
(V4 0 1 0 1)
(V2 (50 / 1024) (1 - 50 / 1024))
1
, newVertex
(V3 (realToFrac x + 25) (realToFrac y + 25) 0)
(V4 0 0 0 1)
(V4 0 1 0 1)
(V2 (50 / 1024) 1)
1
, newVertex
(V3 (realToFrac x - 25) (realToFrac y + 25) 0)
(V4 0 0 0 1)
(V2 (50 / 1024) 1)
(V4 0 1 0 1)
(V2 0 1)
1
]
)