Yes. This game was me starting to learn clojure a year ago and I just
made it sequential. So I used atoms :)

So for making it run in parallel I would have to change the atoms to
refs.

For example movement-update would need to synchronize the grid-cells
and the position of an entity as one atomic action.



On Jul 29, 8:50 am, Laurent PETIT <laurent.pe...@gmail.com> wrote:
> Hi,
>
> 2011/7/29 msappler <michaelsapp...@gmail.com>
>
> > I am also developing a clojure rpg and have open sourced the last
> > alpha version:
>
> >https://code.google.com/p/clojure-rpg/
>
> > ~
>
> > Basically I am using an atom for every entity in the game (monster,
> > player, projectiles, explosions...) and for every cell in the grid of
> > the map.
>
> Without too much thinking about it, I would have thought monsters, players,
> etc. need to be changed in a same "transaction", so would have by default
> implemented them as refs instead of atoms.
>
> Could you elaborate more on the choice of atoms as design decisions ?
>
>
>
>
>
>
>
>
>
> > There are a lot of functions with many side-effects like deal-damage
> > for example:
>
> >https://code.google.com/p/clojure-rpg/source/browse/trunk/src/game/co...
>
> > ---
> >  I use also pure functions for example when applying item boni:
>
> >https://code.google.com/p/clojure-rpg/source/browse/trunk/src/game/it...
>
> > For example an item has 3 boni: movement, +damage, +hp then I update
> > the state and apply the three pure functions on the entity.
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Clojure" group.
> > To post to this group, send email to clojure@googlegroups.com
> > Note that posts from new members are moderated - please be patient with
> > your first post.
> > To unsubscribe from this group, send email to
> > clojure+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/clojure?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to