Change robot keybindings, add build/deploy scripts

This commit is contained in:
Joseph Ferano 2023-07-11 14:34:04 +07:00
parent bc28d9fdf2
commit dad5943ff5
4 changed files with 20 additions and 4 deletions

4
.gitignore vendored
View File

@ -13,4 +13,6 @@ elm-stuff/**
!elm-stuff/packages/Zinggi/
!elm-stuff/packages/Zinggi/elm-obj-loader/
!elm-stuff/packages/Zinggi/elm-obj-loader/1.0.3/
!elm-stuff/packages/Zinggi/elm-obj-loader/1.0.3/**
!elm-stuff/packages/Zinggi/elm-obj-loader/1.0.3/**
/public/
/project.todo

View File

@ -134,13 +134,13 @@ updateRobot { robot , keys } dt =
(keys.left, keys.down, keys.up, keys.right)
(vec3 (sin rot) (sin rot) (cos rot))
robot.pos
0.1
0.03
, rot = if keys.n then rr robot.rot else if keys.m then rl robot.rot else robot.rot
, armRot =
let angle = if keys.y then rr robot.armRot else if keys.h then rl robot.armRot else robot.armRot
let angle = if keys.j then rr robot.armRot else if keys.h then rl robot.armRot else robot.armRot
in clamp -0.5 2.5 angle
, handRot =
let angle = if keys.u then rr robot.handRot else if keys.j then rl robot.handRot else robot.handRot
let angle = if keys.u then rr robot.handRot else if keys.y then rl robot.handRot else robot.handRot
in clamp -1 1 angle}
view: Model -> Html Msg

10
build.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
elm make Scene.elm
sed -i 's/<title>Scene<\/title>/<title>3DFP<\/title>/g' index.html
mkdir -p ./public
mv index.html ./public/
cp -r ./models ./public
cp -r ./textures/ ./public
cd public
zip -r ../3dfp.zip .

4
deploy.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
scp 3dfp.zip joe-vps:~
ssh joe-vps 'unzip -o 3dfp.zip -d ~/websites/3d-fp/ && rm 3dfp.zip'