P-272 - Jira
Python Asteroids+Invaders on GitHub
My keyboard tray Jira is getting too messy. I’ll clean it up and go to a much more high-tech solution. Also: a tiny tweak to screen layout. Also: robots
The glue on the sticky notes gets dry, I get spillage on them, and I can’t use the tray for anything useful, like a sandwich. Many of the things on the tray will never be done, and some of them I don’t even remember clearly enough to know what to do about them.
So let’s clean things up and go to a more high-tech solution: I’m going to make a jira tab in the project and put them in there, in text form. THen I can sort the list, edit it, pat it, prick it, mark it with a D for done, whatever.
I typed in the raw list from the tray, unsorted. There were also some ideas in earlier articles. Ah, yes:
- Scoring
- Saucer
- Two Players
- Bottom Line Damage
And you know what? PyCharm can fix list numbering in Markdown files. I love this program! Here’s the whole thing as of now:
JIRA
- Scoring
- Saucer
- Two Players
- Bottom Line Damage
- Study pytest fixtures
- Better testing around startup
- gunner magic number radius
- game accept coins refers to Asteroids
- Star field
- improve shipmaker interact_with_asteroid
- simplify saucer (asteroids)
- test check-firing keys
- movable location?
- make pygame template with game class?
- See article 147 N.B. test missile point time t???
- rename Fleets and Asteroids_tick
- Robot move is not round trip (robot???)
- Incremental Aim Adjust?
- Use Nullables per James Shore?
- Events ala Rickard Lindberg?
- doctest??
Commit: Jira
Most of those are meaningful to me, and some of them probably even to Faithful Readers. I am tempted to break the list up into a few sections, at least things to code and things to study. Easily done:
JIRA
Program
- Saucer
- Two Players
- Better testing around startup
- gunner magic number radius
- Star field
- improve shipmaker interact_with_asteroid
- simplify saucer (asteroids)
- test check-firing keys
- movable location?
- See article 147 N.B. test missile point time t???
- rename Fleets and Asteroids_tick
- Robot move is not round trip (robot???)
- Events ala Rickard Lindberg?
Done
-
Scoring -
Bottom Line Damage -
Incremental Aim Adjust? -
game accept coins refers to Asteroids
No
- make pygame template with game class?
Study
- Study pytest fixtures
- Use Nullables per James Shore?
- doctest??
Commit: Jira Update.
Some Actual Work?
OK that’s way more mechanism than I need, but it’ll keep the ideas with the program, and keep the keyboard tray available for important snacks.
Now, of course, I’ll do something that isn’t in Jira. Why? Because Jira is mostly where things never to be done go to languish, drinking cocktails and sunning on a beach somewhere, served by polite yet clever sand-resistant robots whose joy comes from service. Or, possibly, where things go to die. I prefer the happier story.
I have two pictures to compare. Here’s our game:
And here’s the original:
What seems to be the case is that the player turret is lower down on the screen, and so are the Shields. I will have to review the original source code to see if I can come up with the actual numbers, but by eye, I think we can see that things need to move down. I would say that there are two player turret heights of blank below the player turret, and one blank blow the shield and above the player.
The Player’s center is calculated like this:
self.rect.center = Vector2(self.left, u.SCREEN_SIZE - 5*32 - 16)
In Photos, I find a picture where I drew a grid on the original game:
Let’s see what we’ve got here. For now, let’s base everything on the bottom line, which is drawn:
rect.bottomleft = (64, u.SCREEN_SIZE - 56)
Let’s get some more sizes. Our Player is nominally 8 pixels high, or 32 at our scale of 4. The Shield is twice that, or 64 pixels on my screen. The bottom line is 4 pixels high, equivalent to a single pixel line on the original.
Reserve Players are centered:
self.rect.center = Vector2(x, u.SCREEN_SIZE - 32)
I think we want:
- Reserves at 32
- Bottom Line at 50
- Player at 128
- Shields at 208
That’ll do for now. But the numbers are all over the map. Let’s move them all to u
.
u.py
BottomLineOffset = 50
InvaderPlayerOffset = 128
ReservePlayerOffset = 32
ShieldOffset = 208
Now they’re all in u
and can be edited as a unit.
Summary
Just a tiny tweak, a step in a good direction, and we even removed a few magic numbers, making them a bit more meaningful and consolidating them into one file. Not exactly profound progress, but a noticeable improvement. (Wasn’t there an add that said that? I can’t find it in the goog. Anyway, the game is a bit more like the original.)
I will not be adding this to the Jira and then crossing it out. The file isn’t there to track my progress, it’s there to serve as a reminder of what I want to do. I might scratch things off sometimes, just for a feeling of accomplishment, or to communicate progress with you, my customer. Or, then again, I might not.
See you next time!