ソースを参照

Initial code past the experimental state of development...

master
コミット
a8ec1e2be2
5個のファイルの変更4349行の追加0行の削除
  1. +3
    -0
      .gitignore
  2. +9
    -0
      compile.sh
  3. +7
    -0
      install.sh
  4. +4231
    -0
      raylib.ads
  5. +99
    -0
      xhampion.adb

+ 3
- 0
.gitignore ファイルの表示

@@ -0,0 +1,3 @@
*.o
*.ali
xhampion

+ 9
- 0
compile.sh ファイルの表示

@@ -0,0 +1,9 @@
#!/bin/bash

set -xe

gnatmake -c xhampion.adb
gnatbind xhampion.ali
gnatlink xhampion.ali -lraylib

exit

+ 7
- 0
install.sh ファイルの表示

@@ -0,0 +1,7 @@
#!/bin/bash

set -xe

cp xhampion /usr/bin/xhampion

exit

+ 4231
- 0
raylib.ads
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 99
- 0
xhampion.adb ファイルの表示

@@ -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;

読み込み中…
キャンセル
保存