Compare commits

..

41 commits

Author SHA1 Message Date
e133e576bf fmt+deps 2026-03-19 20:31:52 +01:00
321530d9d6 dream sql_sessions 2026-03-19 20:31:52 +01:00
4bb063e4eb fix libraries changes 2026-03-19 20:31:52 +01:00
ec90cda066 fmt 2026-03-19 20:31:52 +01:00
a37c5d3ca8 add CI 2026-03-19 20:31:50 +01:00
d90aa54bcf implement wheat ! 2026-03-19 20:24:07 +01:00
8e2faf3b21 implement grid offset 2026-03-19 20:24:06 +01:00
03933d3fd4 better keyboard handling 2026-03-19 20:24:06 +01:00
498d187d76 use wss instead of ws when not on localhost 2026-03-19 20:24:05 +01:00
1f632f65cb add medidate button 2026-03-19 20:24:04 +01:00
d778e05931 implement redirection when user should be logged in/logged out 2026-03-19 20:24:03 +01:00
f8468df472 fix medidate key 2026-03-19 20:24:02 +01:00
1d71c9f09b do not call regularly_call_fun twice as second call will overwrite the
first one...
2026-03-19 20:24:02 +01:00
84129826b5 add topbar with mana, fix bug where newly created state was not stored
in the hashtbl 😠, clean code
2026-03-19 20:24:01 +01:00
15d42e5038 add mana icon 2026-03-19 20:24:00 +01:00
1850c5459d add auto_state_update client & server 2026-03-19 20:24:00 +01:00
461d648ac9 stop using a hardcoded websocket address in ws_client 2026-03-19 20:24:00 +01:00
cafba23610 do not send whole state on action 2026-03-19 20:23:59 +01:00
1cb4f07c0a rm common.ml 2026-03-19 20:23:59 +01:00
aebafe30f3 clean map 2026-03-19 20:23:59 +01:00
5f1d29bda3 wip: state server side; websocket 2026-03-19 20:23:59 +01:00
3c6a373dc9 implement player dir, clean code 2026-03-19 20:23:59 +01:00
7686a096cf make sure there's an odd number of tiles 2026-03-19 20:23:59 +01:00
009a6e8ad5 optim 2026-03-19 20:23:58 +01:00
161273e33b clean code 2026-03-19 20:23:57 +01:00
3db8c7f11f fix rendering, fix the way we use request_animation_frame 2026-03-19 20:23:57 +01:00
e6aab5f780 fix dune :^) 2026-03-19 20:23:56 +01:00
40e873168f remove commented code 2026-03-19 20:23:56 +01:00
9ad4d485a3 use request_animation_frame 2026-03-19 20:23:56 +01:00
a3093dc0c8 remove js ppx 2026-03-19 20:23:56 +01:00
13f017b526 better keyboard 2026-03-19 20:23:56 +01:00
8f61881fe8 Brrrr 2026-03-19 20:23:56 +01:00
6357674db8 add basic movements 2026-03-19 20:23:56 +01:00
7cb03b8779 draw canvas from a map 2026-03-19 20:23:56 +01:00
00c9c587c7 get display to work 2026-03-19 20:23:55 +01:00
238e6fba75 clean code 2026-03-19 20:23:54 +01:00
9b1dbda081 update style 2026-03-19 20:23:53 +01:00
9142651ec0 upload tiles 2026-03-19 20:23:52 +01:00
ee626ccd61 clean code 2026-03-19 20:23:49 +01:00
5ec03d06c2 do not force file to exist 2026-03-19 20:23:31 +01:00
4bd924d65f update .ocamlformat 2026-03-19 20:23:17 +01:00
7 changed files with 70 additions and 47 deletions

View file

@ -6,7 +6,7 @@ jobs:
build:
runs-on: ubuntu-latest
container:
image: zapashcanon/gitea-ocaml-ci:latest
image: pena/gitea-ocaml-ci:latest
steps:
- name: checkout
uses: actions/checkout@v4

View file

@ -1,4 +1,4 @@
version=0.27.0
version=0.28.1
assignment-operator=end-line
break-cases=fit
break-fun-decl=wrap

View file

@ -1,23 +1,15 @@
(lang dune 2.9)
(implicit_transitive_deps false)
(name pellest)
(implicit_transitive_deps false)
(generate_opam_files true)
(authors "swrup")
(maintainers "swrup@protonmail.com")
(authors "swrup@protonmail.com" "pena <pena@kumikode.org>")
(maintainers "swrup@protonmail.com" "pena <pena@kumikode.org>")
(source
(uri TODO/pellest))
(homepage TODO/pellest)
(bug_reports TODO/pellest)
(documentation TODO/pellest)
(generate_opam_files true)
(uri git+https://forge.kumikode.org/swrup/pellest.git))
(homepage https://forge.kumikode.org/swrup/pellest)
(bug_reports https://forge.kumikode.org/swrup/pellest/issues)
(package
(name pellest)
@ -28,4 +20,20 @@
(pellest TODO TODO TODO TODO))
(depends
(ocaml
(>= 4.08))))
(>= 4.08))
bos
brr
caqti
caqti-driver-sqlite3
directories
dream
emile
fpath
lambdasoup
lwt
lwt_ppx
safepass
scfg
tyxml
uri
uuidm))

View file

@ -2,15 +2,30 @@
opam-version: "2.0"
synopsis: "OCaml library/executable to TODO"
description: "pellest is an OCaml library/executable to TODO."
maintainer: ["swrup@protonmail.com"]
authors: ["swrup"]
maintainer: ["swrup@protonmail.com" "pena <pena@kumikode.org>"]
authors: ["swrup@protonmail.com" "pena <pena@kumikode.org>"]
tags: ["pellest" "TODO" "TODO" "TODO" "TODO"]
homepage: "TODO/pellest"
doc: "TODO/pellest"
bug-reports: "TODO/pellest"
homepage: "https://forge.kumikode.org/swrup/pellest"
bug-reports: "https://forge.kumikode.org/swrup/pellest/issues"
depends: [
"dune" {>= "2.9"}
"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}
]
build: [
@ -29,4 +44,4 @@ build: [
]
["dune" "install" "-p" name "--create-install-files" name]
]
dev-repo: "TODO/pellest"
dev-repo: "git+https://forge.kumikode.org/swrup/pellest.git"

View file

@ -17,6 +17,8 @@
user
ws)
(libraries
shared
;
bos
caqti
caqti.blocking
@ -24,7 +26,6 @@
directories
dream
emile
shared
fpath
lambdasoup
lwt

View file

@ -191,22 +191,22 @@ let apply_last_key () =
let open State in
Kb.get_last ()
|> Option.iter (fun code_or_key ->
let act =
(* when you add something here, don't forget to add the corresponding case in `keypress_handler` *)
match code_or_key with
| "KeyW" | "ArrowUp" -> Move_offset Up
| "KeyA" | "ArrowLeft" -> Move_offset Left
| "KeyS" | "ArrowDown" -> Move_offset Down
| "KeyD" | "ArrowRight" -> Move_offset Right
| "m" -> Meditate
| "p" -> Plant_wheat
| _ ->
(* if this happen, it means we're adding
let act =
(* when you add something here, don't forget to add the corresponding case in `keypress_handler` *)
match code_or_key with
| "KeyW" | "ArrowUp" -> Move_offset Up
| "KeyA" | "ArrowLeft" -> Move_offset Left
| "KeyS" | "ArrowDown" -> Move_offset Down
| "KeyD" | "ArrowRight" -> Move_offset Right
| "m" -> Meditate
| "p" -> Plant_wheat
| _ ->
(* if this happen, it means we're adding
bad values in `keypress_handler`
and that should be fixed *)
assert false
in
Queue.add act input_queue )
assert false
in
Queue.add act input_queue )
let render state =
draw_canvas state;

View file

@ -104,14 +104,13 @@ let rec check_action state = function
; Set_offset (offset_x, offset_y)
]
in
begin
match dir' with
| None -> Ok offset_action
| Some dir' -> begin
match check_action state (Move dir') with
| Error _e as e -> e
| Ok actions -> Ok (offset_action @ actions)
end
begin match dir' with
| None -> Ok offset_action
| Some dir' -> begin
match check_action state (Move dir') with
| Error _e as e -> e
| Ok actions -> Ok (offset_action @ actions)
end
end
| Plant_wheat -> (
let { Map.x; y; dir } = state.player_pos in