Adding sprites and minor code changes...

This commit is contained in:
Ognjen Milan Robovic 2024-03-29 18:27:07 -04:00
parent a8ec1e2be2
commit 41a8d6af1f
8 changed files with 54 additions and 5 deletions

BIN
sprite/hand.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

11
sprite/meme.mtl Normal file
View File

@ -0,0 +1,11 @@
newmtl material
Ns 90.0
Ka 1.0 1.0 1.0
Kd 0.5 0.5 0.5
Ks 0.5 0.5 0.5
Ke 0.0 0.0 0.0
Ni 1.0
d 1.0
illum 2
map_Kd meme.png

15
sprite/meme.obj Normal file
View File

@ -0,0 +1,15 @@
mtllib meme.mtl
o square
v -1.0 0.0 1.0
v 1.0 0.0 1.0
v -1.0 0.0 -1.0
v 1.0 0.0 -1.0
vt 1.0 1.0
vt 0.0 1.0
vt 0.0 0.0
vt 1.0 0.0
vn 0.0 1.0 0.0
usemtl material
s off
f 1/1/1 2/2/1 4/3/1 3/4/1

BIN
sprite/meme.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

11
sprite/wall.mtl Normal file
View File

@ -0,0 +1,11 @@
newmtl material
Ns 90.0
Ka 1.0 1.0 1.0
Kd 0.5 0.5 0.5
Ks 0.5 0.5 0.5
Ke 0.0 0.0 0.0
Ni 1.0
d 1.0
illum 2
map_Kd wall.png

15
sprite/wall.obj Normal file
View File

@ -0,0 +1,15 @@
mtllib wall.mtl
o square
v -1.0 0.0 0.0
v 1.0 0.0 0.0
v -1.0 2.0 0.0
v 1.0 2.0 0.0
vt 0.0 0.0
vt 1.0 0.0
vt 1.0 1.0
vt 0.0 1.0
vn 0.0 1.0 0.0
usemtl material
s off
f 1/1/1 2/2/1 4/3/1 3/4/1

BIN
sprite/wall.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@ -55,7 +55,6 @@ begin
gameplay: loop
exit when window_should_close;
--~update_camera (view'access, camera_first_person);
if is_key_pressed (key_w) then movement.x := movement.x + 1.0;
elsif is_key_pressed (key_s) then movement.x := movement.x - 1.0;
elsif is_key_pressed (key_a) then movement.y := movement.y - 1.0;
@ -67,8 +66,6 @@ begin
rotation.x := dd.x;
update_camera_pro (view'access, movement, rotation, 1.0);
--~update_camera_pro (view'access, (0.0, 0.0, 0.0), rotation, 1.0);
--~update_camera_pro (view'access, movement, (0.0, 0.0, 0.0), 1.0);
begin_drawing;
@ -80,8 +77,8 @@ begin
loop
for j in 0 .. 40
loop
draw_model (model_array (0), (float (i) * (-4.0), -10.0, float (j) * (-4.0)), 2.0, white);
draw_model (model_array (1), (float (i) * (-4.0), -10.0, float (j) * (-4.0)), 2.0, white);
draw_model (model_array (0), (float (i) * (-4.0), -1.0, float (j) * (-4.0)), 2.0, white);
draw_model (model_array (1), (float (i) * (-4.0), -1.0, float (j) * (-4.0)), 2.0, white);
end loop;
end loop;