src/clojurecraft/actions.clj @ c41de2845803
Start working on chunks and gravity.
author |
Steve Losh <steve@stevelosh.com> |
date |
Thu, 04 Aug 2011 00:22:22 -0400 |
parents |
0551a05c0e1e |
children |
6f54b979c6b5 |
(ns clojurecraft.actions
(:use [clojurecraft.util]))
(defn move [bot x-change y-change z-change]
(let [player (:player bot)]
(dosync
(let [location (:loc @player)
new-location (merge location
{:x (+ x-change (:x location))
:y (+ y-change (:y location))
:z (+ z-change (:z location))
:stance (+ y-change (:stance location))})]
(alter player merge {:loc new-location}))))
nil)