Hey @Efi !
I'm coding my Go game in play-clj and I have MANY questions!

How do you think it's the best way to handle a turn based game?
I'm migrating a game I made for the console and I handled the loop by myself and now I'm a little bit lost :(

@ekaitz_zarraga so you want to be event-driven, you need to have an event (or keybind) to process the next turn, and then you just return the new game state to the looping function as usual in play-clj

@Efi then I don't need a on-render by default because I don't need to render periodically ?


@ekaitz_zarraga you still need to render, but you can keep passing the same game object you got as an argument at the tail to render the same thing unchanged

@ekaitz_zarraga or iirc returning null also makes play-clj reuse the last object

@Efi The entities object for the screen is also to put the "status" there or only for the things you want to render on the screen?
I'm sooooo new to all this stuff (including clojure)

@ekaitz_zarraga entities should have all your game state
I usually just have it be a map to organize everything under it, and in render I cherry pick what to actually render dinamically

@Efi Perfect! I got it!
I think I can integrate the whole thang easily :D

I have to learn how to overlay some stuff and I think I'll be done soonish :D

@ekaitz_zarraga just have different lists for each layer and render them in order =P

@Efi hm!
And if the layer is just the same during the whole game? is there a better way to do it?

PS: Thank you, baby, you are sooo helpful.

@ekaitz_zarraga why would you have only one layer?
you can implement it as separate lists or as a property to filter on, but if you want to make sure something is always drawn over another thing, you need to draw them in the right order

@Efi I'm making a boardgame, that makes the thing be just the board and the other stuff on top of it.
But I can handle the board as a group of tiles and print them like that.

I'll keep playing and I'll come back to you :D

Thank you :)

Sign in to participate in the conversation

Follow friends and discover new ones. Publish anything you want: links, pictures, text, video. This server is run by the main developers of the Mastodon project. Everyone is welcome as long as you follow our code of conduct!