src/clojurecraft/actions.clj @ 827c992e7b65
Clean up in.clj.
author |
Steve Losh <steve@stevelosh.com> |
date |
Thu, 21 Jul 2011 18:47:59 -0400 |
parents |
cc621ecb4d27 |
children |
0431d566789d |
(ns clojurecraft.actions
(:use [clojurecraft.util]))
(defn move [bot x-change y-change z-change]
(let [player (:player bot)]
(dosync
(let [location (:location @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 {:location new-location}))))
bot)