src/clojurecraft/actions.clj @ 085e63240d4f
Bit twiddling.
author |
Steve Losh <steve@stevelosh.com> |
date |
Wed, 03 Aug 2011 21:11:51 -0400 |
parents |
0551a05c0e1e |
children |
c41de2845803 |
(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}))))
bot)