Initial code past the experimental state of development...
This commit is contained in:
parent
0293110305
commit
a8ec1e2be2
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
*.o
|
||||||
|
*.ali
|
||||||
|
xhampion
|
9
compile.sh
Normal file
9
compile.sh
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -xe
|
||||||
|
|
||||||
|
gnatmake -c xhampion.adb
|
||||||
|
gnatbind xhampion.ali
|
||||||
|
gnatlink xhampion.ali -lraylib
|
||||||
|
|
||||||
|
exit
|
7
install.sh
Normal file
7
install.sh
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -xe
|
||||||
|
|
||||||
|
cp xhampion /usr/bin/xhampion
|
||||||
|
|
||||||
|
exit
|
4231
raylib.ads
Normal file
4231
raylib.ads
Normal file
File diff suppressed because it is too large
Load Diff
99
xhampion.adb
Normal file
99
xhampion.adb
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
with raylib;
|
||||||
|
use raylib;
|
||||||
|
|
||||||
|
procedure xhampion is
|
||||||
|
|
||||||
|
type monster_index is (
|
||||||
|
afrit,
|
||||||
|
brown_chaos_serpent,
|
||||||
|
centaur,
|
||||||
|
dark_bishop,
|
||||||
|
death_wyvern,
|
||||||
|
ettin,
|
||||||
|
green_chaos_serpent,
|
||||||
|
maulotaur,
|
||||||
|
pig,
|
||||||
|
reiver,
|
||||||
|
stalker,
|
||||||
|
wendigo
|
||||||
|
);
|
||||||
|
|
||||||
|
view : aliased camera_3d := (
|
||||||
|
position => (0.0, 0.0, 0.0),
|
||||||
|
target => (0.0, 0.0, 1.0),
|
||||||
|
up => (0.0, 1.0, 0.0),
|
||||||
|
field_of_view => 90.0,
|
||||||
|
projection => camera_perspective
|
||||||
|
);
|
||||||
|
|
||||||
|
model_count : natural := 2;
|
||||||
|
model_array : array (0 .. 1) of model;
|
||||||
|
|
||||||
|
texture_count : natural := 2;
|
||||||
|
texture_array : array (0 .. 1) of texture;
|
||||||
|
|
||||||
|
movement : vector_3d := (0.0, 0.0, 0.0);
|
||||||
|
rotation : vector_3d := (0.0, 0.0, 0.0);
|
||||||
|
|
||||||
|
dd : vector_2d := (0.0, 0.0);
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
open_window (1800, 900, "Xhampion" & character'val (0));
|
||||||
|
|
||||||
|
disable_cursor;
|
||||||
|
|
||||||
|
set_target_fps (60);
|
||||||
|
|
||||||
|
set_trace_log_level (log_none);
|
||||||
|
|
||||||
|
model_array (0) := load_model ("./sprite/wall.obj" & character'val (0));
|
||||||
|
model_array (1) := load_model ("./sprite/meme.obj" & character'val (0));
|
||||||
|
|
||||||
|
texture_array (0) := load_texture ("./sprite/hand.png" & character'val (0));
|
||||||
|
|
||||||
|
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;
|
||||||
|
elsif is_key_pressed (key_d) then movement.y := movement.y + 1.0;
|
||||||
|
end if;
|
||||||
|
|
||||||
|
dd := get_mouse_delta;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
clear_background (sky_blue);
|
||||||
|
|
||||||
|
begin_mode_3d (view);
|
||||||
|
|
||||||
|
for i in 0 .. 40
|
||||||
|
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);
|
||||||
|
end loop;
|
||||||
|
end loop;
|
||||||
|
|
||||||
|
end_mode_3d;
|
||||||
|
|
||||||
|
draw_texture (texture_array (0), (get_screen_width - 960) / 2, get_screen_height - 600, white);
|
||||||
|
|
||||||
|
draw_fps (0, 0);
|
||||||
|
|
||||||
|
end_drawing;
|
||||||
|
end loop gameplay;
|
||||||
|
|
||||||
|
close_window;
|
||||||
|
|
||||||
|
end xhampion;
|
Loading…
Reference in New Issue
Block a user