aboutsummaryrefslogtreecommitdiffstats
path: root/pong/README
diff options
context:
space:
mode:
authorEdvard Thörnros <edvard.thornros@gmail.com>2021-02-01 20:57:55 +0100
committerEdvard Thörnros <edvard.thornros@gmail.com>2021-02-01 21:38:34 +0100
commite86852857bc6f6ca1e1cd81db494071c5d9e3ff1 (patch)
tree71f111699dd0d7526dbe5ee334c477db6e0362e0 /pong/README
parente9ce94d72e1e8e51b7843b414504a07e132813e1 (diff)
parentfd4868df1fd24c05bce5c92cf8289fa755f25875 (diff)
downloadsylt-e86852857bc6f6ca1e1cd81db494071c5d9e3ff1.tar.gz
Merge branch 'main' into vectors
Diffstat (limited to 'pong/README')
-rw-r--r--pong/README37
1 files changed, 37 insertions, 0 deletions
diff --git a/pong/README b/pong/README
new file mode 100644
index 0000000..be718ec
--- /dev/null
+++ b/pong/README
@@ -0,0 +1,37 @@
+PONG
+====
+
+Made for Global Game Jam 2021 at LiU Game Jam's site.
+
+The language wasn't really ready for a normal game so we wanted to make Pong
+(the easiest game we could think of) while fixing what we needed to make it
+work.
+
+Building
+--------
+
+Clone the entire tihdy-repo, cd into the pong-directory and then cargo run.
+
+Modifying
+---------
+
+All game logic is located in pong.tdy. Most of the configuration should be
+straight forward. If you want to modify the controls, you need to change both
+the string passed from pong.tdy as well as the respective function in src/main.rs
+(key_down).
+
+If you want to add more rust functions (for example, to draw text to the screen)
+you need to add it like the already existing functions. All functions need a
+return type and a return value, even if it is a Type::Void and Value::Nil. (See
+e.g. clear for an example.) For a draw_text you probably want to take a
+Value::String(s), Value::Float(x), Value::Float(y) and so on. Inside the block
+you then write your normal Rusty code.
+
+After writing your function you also need to link it so you can use it from the
+game file. Add it to 'functions' like the other linked functions inside main()
+in src/main.rs.
+
+After linking, the only thing left to do is call it from the game logic. You'll
+get a type error if you pass the wrong parameters. Additional parameter
+combinations can be set (much like normal function overloading) should you have
+the need by adding more "arms" to the extern_function!().