I gave myself two gifts for Christmas: A set of new bathroom rugs, and a few guilt-free days to learn the LibGDX game framework so I can eventually rewrite my football game. (Usually I think, “You need to finish writing XYZ,” so “a few guilt-free days” means not having those thoughts, or having them but ignoring them.)
The source code for Beginning Java Game Development with LibGDX is at the URL shown.
This is a good resource for LibGDX programming on Android.
This is a page from my book, “A Survival Guide for New Consultants”
“The discipline of Zen consists in upsetting this groundwork once and for all, and reconstructing the old frame on an entirely new basis.”
I was talking to a friend the other day about what I learned in college, and I came to the conclusion that I learned two major things.
The best advice I’ve gotten for practicing mindfulness meditation while not sitting in meditation – i.e., in active meditation – is to make something of a game of it. When I wash the dishes it’s like, “How deep can I get while I wash these dishes?” Or when talking to another person, you both put down the cellphones and think, “Okay, we’re both here right now, how much can we focus only on each other and be here in this moment while we talk? How deep can we go?”
I was reminded of this when I read this line recently: “Finally, I got it! The menial tasks I had been assigned to around the temple were meant to be an exercise in meditation. Whatever I was doing, my job was to try to stay in samadhi.”
(That quote comes from the book, The Science of Meditation.)
This is a page from my book, Functional Programming, Simplified
“In theory, theory and practice are the same. In practice, they’re not.”
Now that I’ve given you a little background about what I think “state” is, let’s build a simple game that requires us to use state. I’ll build the game using recursion, and also immutable state — something I had never heard of when I first starting writing the Scala Cookbook.
One thing I learned last night about my XO Play football game is that even in a “thinking man’s game” like this, visual perspective is important. I thought I would like the game as I showed it yesteday, as if you were looking at it from a coordinator’s box or sideline seat, but even though this image is a poor mockup and the perspective isn’t great, I like it better. (And of course now this makes me want to show real players (with depth) instead of Xs and Os.)
I took some time today to work on the UI for the second version of my Android football game. This is my current best-guess, rough-sketch of what it should look like:
The basic idea is that when you’re on offense you (a) choose the formation, (b) choose the play, then (c) press Go to run the play. This gives a chance to change the formations and plays, especially once the defense gets smart enough to respond to what you’re doing.
I’m considering using Easy Rules as a simple “rules engine” in my Android Football Game application, primarily because (a) there are a ton of “rules” involved in having the computer call offensive and defensive plays, and (b) I’m trying to find a way to simplify that code and make it more maintainable.
The Easy Rules website has a Hello, world demo you can look at to get started, but after that, here is my example.