Compare commits
40 commits
e133e576bf
...
87ba0e9d26
| Author | SHA1 | Date | |
|---|---|---|---|
| 87ba0e9d26 | |||
| 0027a047c6 | |||
| e9954bf54e | |||
|
|
8955d9d73f | ||
|
|
acb2342081 | ||
|
|
feebcd3841 | ||
|
|
2945e7d478 | ||
|
|
b0d466ac08 | ||
|
|
0fcd970445 | ||
|
|
078b679bc2 | ||
|
|
3f4c1b063e | ||
|
|
f6ca371676 | ||
|
|
3a9d5daf02 | ||
|
|
51129ecb2e | ||
| b074eac54f | |||
|
|
cdd46850bf | ||
| caffcbb527 | |||
| 86489c5394 | |||
| 753a50bf85 | |||
| 91cff202f6 | |||
|
|
549aa39e09 | ||
|
|
365c558f35 | ||
|
|
ddeba99f2e | ||
|
|
0aded75cb7 | ||
|
|
b89202dfb0 | ||
| 1b89d35dfd | |||
| 484203c927 | |||
| de904f86cc | |||
| 4b2e90f737 | |||
| 5bbfd54efb | |||
| 82dcc24eed | |||
|
|
9833eb520e | ||
|
|
dddcf9b488 | ||
|
|
b504b1a69d | ||
|
|
1736a4c905 | ||
|
|
eda6a2d001 | ||
|
|
ac2ede257f | ||
|
|
20f18bcd76 | ||
|
|
97864116bb | ||
|
|
be2a16e0b9 |
7 changed files with 48 additions and 71 deletions
|
|
@ -6,7 +6,7 @@ jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: pena/gitea-ocaml-ci:latest
|
image: zapashcanon/gitea-ocaml-ci:latest
|
||||||
steps:
|
steps:
|
||||||
- name: checkout
|
- name: checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
version=0.28.1
|
version=0.27.0
|
||||||
assignment-operator=end-line
|
assignment-operator=end-line
|
||||||
break-cases=fit
|
break-cases=fit
|
||||||
break-fun-decl=wrap
|
break-fun-decl=wrap
|
||||||
|
|
|
||||||
42
dune-project
42
dune-project
|
|
@ -1,15 +1,23 @@
|
||||||
(lang dune 2.9)
|
(lang dune 2.9)
|
||||||
(name pellest)
|
|
||||||
(implicit_transitive_deps false)
|
|
||||||
(generate_opam_files true)
|
|
||||||
|
|
||||||
(authors "swrup@protonmail.com" "pena <pena@kumikode.org>")
|
(implicit_transitive_deps false)
|
||||||
(maintainers "swrup@protonmail.com" "pena <pena@kumikode.org>")
|
|
||||||
|
(name pellest)
|
||||||
|
|
||||||
|
(authors "swrup")
|
||||||
|
|
||||||
|
(maintainers "swrup@protonmail.com")
|
||||||
|
|
||||||
(source
|
(source
|
||||||
(uri git+https://forge.kumikode.org/swrup/pellest.git))
|
(uri TODO/pellest))
|
||||||
(homepage https://forge.kumikode.org/swrup/pellest)
|
|
||||||
(bug_reports https://forge.kumikode.org/swrup/pellest/issues)
|
(homepage TODO/pellest)
|
||||||
|
|
||||||
|
(bug_reports TODO/pellest)
|
||||||
|
|
||||||
|
(documentation TODO/pellest)
|
||||||
|
|
||||||
|
(generate_opam_files true)
|
||||||
|
|
||||||
(package
|
(package
|
||||||
(name pellest)
|
(name pellest)
|
||||||
|
|
@ -20,20 +28,4 @@
|
||||||
(pellest TODO TODO TODO TODO))
|
(pellest TODO TODO TODO TODO))
|
||||||
(depends
|
(depends
|
||||||
(ocaml
|
(ocaml
|
||||||
(>= 4.08))
|
(>= 4.08))))
|
||||||
bos
|
|
||||||
brr
|
|
||||||
caqti
|
|
||||||
caqti-driver-sqlite3
|
|
||||||
directories
|
|
||||||
dream
|
|
||||||
emile
|
|
||||||
fpath
|
|
||||||
lambdasoup
|
|
||||||
lwt
|
|
||||||
lwt_ppx
|
|
||||||
safepass
|
|
||||||
scfg
|
|
||||||
tyxml
|
|
||||||
uri
|
|
||||||
uuidm))
|
|
||||||
|
|
|
||||||
27
pellest.opam
27
pellest.opam
|
|
@ -2,30 +2,15 @@
|
||||||
opam-version: "2.0"
|
opam-version: "2.0"
|
||||||
synopsis: "OCaml library/executable to TODO"
|
synopsis: "OCaml library/executable to TODO"
|
||||||
description: "pellest is an OCaml library/executable to TODO."
|
description: "pellest is an OCaml library/executable to TODO."
|
||||||
maintainer: ["swrup@protonmail.com" "pena <pena@kumikode.org>"]
|
maintainer: ["swrup@protonmail.com"]
|
||||||
authors: ["swrup@protonmail.com" "pena <pena@kumikode.org>"]
|
authors: ["swrup"]
|
||||||
tags: ["pellest" "TODO" "TODO" "TODO" "TODO"]
|
tags: ["pellest" "TODO" "TODO" "TODO" "TODO"]
|
||||||
homepage: "https://forge.kumikode.org/swrup/pellest"
|
homepage: "TODO/pellest"
|
||||||
bug-reports: "https://forge.kumikode.org/swrup/pellest/issues"
|
doc: "TODO/pellest"
|
||||||
|
bug-reports: "TODO/pellest"
|
||||||
depends: [
|
depends: [
|
||||||
"dune" {>= "2.9"}
|
"dune" {>= "2.9"}
|
||||||
"ocaml" {>= "4.08"}
|
"ocaml" {>= "4.08"}
|
||||||
"bos"
|
|
||||||
"brr"
|
|
||||||
"caqti"
|
|
||||||
"caqti-driver-sqlite3"
|
|
||||||
"directories"
|
|
||||||
"dream"
|
|
||||||
"emile"
|
|
||||||
"fpath"
|
|
||||||
"lambdasoup"
|
|
||||||
"lwt"
|
|
||||||
"lwt_ppx"
|
|
||||||
"safepass"
|
|
||||||
"scfg"
|
|
||||||
"tyxml"
|
|
||||||
"uri"
|
|
||||||
"uuidm"
|
|
||||||
"odoc" {with-doc}
|
"odoc" {with-doc}
|
||||||
]
|
]
|
||||||
build: [
|
build: [
|
||||||
|
|
@ -44,4 +29,4 @@ build: [
|
||||||
]
|
]
|
||||||
["dune" "install" "-p" name "--create-install-files" name]
|
["dune" "install" "-p" name "--create-install-files" name]
|
||||||
]
|
]
|
||||||
dev-repo: "git+https://forge.kumikode.org/swrup/pellest.git"
|
dev-repo: "TODO/pellest"
|
||||||
|
|
|
||||||
3
src/dune
3
src/dune
|
|
@ -17,8 +17,6 @@
|
||||||
user
|
user
|
||||||
ws)
|
ws)
|
||||||
(libraries
|
(libraries
|
||||||
shared
|
|
||||||
;
|
|
||||||
bos
|
bos
|
||||||
caqti
|
caqti
|
||||||
caqti.blocking
|
caqti.blocking
|
||||||
|
|
@ -26,6 +24,7 @@
|
||||||
directories
|
directories
|
||||||
dream
|
dream
|
||||||
emile
|
emile
|
||||||
|
shared
|
||||||
fpath
|
fpath
|
||||||
lambdasoup
|
lambdasoup
|
||||||
lwt
|
lwt
|
||||||
|
|
|
||||||
|
|
@ -191,22 +191,22 @@ let apply_last_key () =
|
||||||
let open State in
|
let open State in
|
||||||
Kb.get_last ()
|
Kb.get_last ()
|
||||||
|> Option.iter (fun code_or_key ->
|
|> Option.iter (fun code_or_key ->
|
||||||
let act =
|
let act =
|
||||||
(* when you add something here, don't forget to add the corresponding case in `keypress_handler` *)
|
(* when you add something here, don't forget to add the corresponding case in `keypress_handler` *)
|
||||||
match code_or_key with
|
match code_or_key with
|
||||||
| "KeyW" | "ArrowUp" -> Move_offset Up
|
| "KeyW" | "ArrowUp" -> Move_offset Up
|
||||||
| "KeyA" | "ArrowLeft" -> Move_offset Left
|
| "KeyA" | "ArrowLeft" -> Move_offset Left
|
||||||
| "KeyS" | "ArrowDown" -> Move_offset Down
|
| "KeyS" | "ArrowDown" -> Move_offset Down
|
||||||
| "KeyD" | "ArrowRight" -> Move_offset Right
|
| "KeyD" | "ArrowRight" -> Move_offset Right
|
||||||
| "m" -> Meditate
|
| "m" -> Meditate
|
||||||
| "p" -> Plant_wheat
|
| "p" -> Plant_wheat
|
||||||
| _ ->
|
| _ ->
|
||||||
(* if this happen, it means we're adding
|
(* if this happen, it means we're adding
|
||||||
bad values in `keypress_handler`
|
bad values in `keypress_handler`
|
||||||
and that should be fixed *)
|
and that should be fixed *)
|
||||||
assert false
|
assert false
|
||||||
in
|
in
|
||||||
Queue.add act input_queue )
|
Queue.add act input_queue )
|
||||||
|
|
||||||
let render state =
|
let render state =
|
||||||
draw_canvas state;
|
draw_canvas state;
|
||||||
|
|
|
||||||
15
src/state.ml
15
src/state.ml
|
|
@ -104,13 +104,14 @@ let rec check_action state = function
|
||||||
; Set_offset (offset_x, offset_y)
|
; Set_offset (offset_x, offset_y)
|
||||||
]
|
]
|
||||||
in
|
in
|
||||||
begin match dir' with
|
begin
|
||||||
| None -> Ok offset_action
|
match dir' with
|
||||||
| Some dir' -> begin
|
| None -> Ok offset_action
|
||||||
match check_action state (Move dir') with
|
| Some dir' -> begin
|
||||||
| Error _e as e -> e
|
match check_action state (Move dir') with
|
||||||
| Ok actions -> Ok (offset_action @ actions)
|
| Error _e as e -> e
|
||||||
end
|
| Ok actions -> Ok (offset_action @ actions)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
| Plant_wheat -> (
|
| Plant_wheat -> (
|
||||||
let { Map.x; y; dir } = state.player_pos in
|
let { Map.x; y; dir } = state.player_pos in
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue