036 // Distractions VII: “Stupid Jaywalking Game, Part I”
So I decided to take a break from my normal project to try this new thing that flew into my head that felt like it would be fairly easy to carry out, and this is the result so far.
The basic concept of the game is that the player has to move from their current location to another point on the map-- some point at the side of a road-- as quickly as they can. The challenge is that they will frequently be called upon to cross streets full of cars. Cars which will hit them if they do not time themselves correctly. Being hit by a car concludes the game.
The cars follow a set of predictable rules and broadcast their behaviour in various ways, and the player can respond to that by planning out their trip from their location to their destination accordingly. The sooner they arrive, the more points it is worth to them.
So far, I have been working on the cars’ basic movement and map generation, which has been fairly straightforward. The map in the animation above, for instance, is generated from this list of points:
[(50, 50), (200, 50), ('B', 350, 50, 24), ('B', 450, 200), (450, 350), ('B', 450, 500), (580, 500), (660, 500)]
The xytuples give fixed points and the 'B'-tuples indicate Bezier curve control points, and some other data for the curve generator.
Getting Pygame to make maps from fairly simple strings was not challenging and the Bezier curve generator was pretty easy stuff, too, though having the cars adjust their speed as they navigate sharp (and shallow) corners was a bit troublesome due to a few clumsy mistakes I made with numbers.
The next thing I need to do for it is have the roads connect properly to intersections, which will have a traffic control unit that directs approaching and waiting vehicles. I also need to have vehicles determine complete routes through that intersection and the map at their destination. Some buildings to decorate the map, a mechanism for choosing destinations for the player, and I suppose, the player's representative in the game, as well.
A few things; not many.
Not bad for three or four days' work. I am looking forward to working more on it, too.
I have been working on my main project as well these past couple of weeks (sorry I missed last week's post, by the way), but I have also found myself sidetracked somewhat. Windows 10, though it has been civil so far, has taking a change of attitude from "Unremarkable but cooperative" to "You are not my father and I will install whatever broken updates I want, and start waking up from hibernation while you are carrying me in your bag." The garbage update was especially jarring because my computer was stuck in a weird deadlock state where it could not boot up. Another surprise update had incapacitated my other laptop at the time, as well. That was at three in the morning. I was less amused. Again, one of my brilliant girlfriends helped bail me out, and now things are more or less back on the rails. But Windows 7 never gave me this kind of obscene trouble. Additionally, I discovered that it was scaling everything on my screen up to 125%, which is great for looking at whatever, but it had been making a huge mess of my art at 1xzoom. I had noticed the problem long ago but did not know what the source of the problem was exactly. I found it and corrected it. A nuisance, but at least this one was understandable.
Anyway, I will try and post more of my artwork from the main project sometime soon; at this point, it is not much to show, but perhaps you will find it entertaining in the time it takes to scroll past it. <3
Thanks for reading all the way to the end! :D
See you again next time! :y