LD20: Coding the Plaza and Entities

So I’ve been tackling the Plaza, which was originally planned to be a simple representation of the play area grid.

It also keeps track of each Entity running around. I keep Pedestrians, Couriers, and EnemyAgents in separate containers, and there is a single VIP (the goal) as well. All Entities have position, orientation, and a string that represents how to draw them.

Here’s how they differ:

Pedestrians also have a preferred turning direction. When they run into an occupied space, they try to turn in their preferred turning direction first. If that space is also occupied, then they try the other direction. If that space is also occupied, then they remain in their original orientation and stand still that turn. To illustrate, a Pedestrian with an affinity to turning left is facing to the right. In trying to move forward he finds that the tile is occupied by another Entity. So he tries to move up (turning left from his right-facing orientation) first before trying to move down.

Couriers can carry a package. There are plans to only allow one package in the game, so only one Courier will actually have the package at a time.

EnemyAgents have nothing special about them except that they cannot be shoved. If an Entity tries to shove into an EnemyAgent, the action won’t happen. Likewise if a chain of shoves results in an attempt to shove an EnemyAgent, the shoves won’t happen.

VIPs do not move, so they don’t have an orientation. They just stand in one place, waiting for the package to be delivered.

I’ve been wondering if I should have an explicit representation of the Package itself, but I’m getting sleepy and exhausted, so I figured it would be best not to make decisions like this until I’m awake enough to think them through.

Once I get these new objects rendering, I think the next task is to create some instances of Couriers and get them moving about the play area according to player input.

There are 21.5 hours left in the compo. I figure I’ll wake up with 13-14 hours left to go. Wee!

3 comments to LD20: Coding the Plaza and Entities

  • Kudos for doing the incredibly short game-development challenges. Hell, especially if you’re working in C++!

    My brain just doesn’t work like that, otherwise I might give it a go 😉

  • Best of luck to you! I’m not sure I could even plan my code in that amount of time, let alone write it.

    Btw, are you using SDL blitting for your graphics or OpenGL?

  • Thanks, guys! I think that I’m finally gaining experience enough that certain architectural decisions are become second nature. Unfortunately, I still need a lot more experience for other architectural decisions. B-)

    Clean3d: I’m using SDL. It’s simple, yet powerful, and it doesn’t add a lot to my project’s dependencies. Plus, I haven’t touched OpenGL or 3D since I first learned it, so I’d have to take the time to get myself reacquainted with it if I ever want to use it in the future.