Game Progress Update #67
Hello World, and welcome to the sixty seventh Dev with Dave Game Progress Update.
Thankfully this time round I did manage to find some time to work on Flappy vaders. Since I started this project I have definitely had a lot less free time to work on it than I expected.
But I don’t think I’ve done too badly. The game really does seem to be taking shape. And it definitiely helps with motivation knowing tha the end is nearly in sight! 🙂
Let me tell you what I have done this time round.
The plan for this fortnight
So this fortnight I am back on the bug fixes. There are three bugs in the In progress column of the Trello. Now I have finished working on the promotional video, I shall attempt to finish them off as well.
- Bullet X speed issue.
- Upgrades store issue.
- Scratch card prize issue.
Before I can do anything, I must remove the edits I made for the video in the previous progress update.
Removing the edits.
As I said in an earlier post, I’ve employed two methods to help make removing the edits I’d previously made a little easier.
Firstly I have written a log in my OneNote of the changes I made. And secondly, I have used a Keyword in the comments so I can ctrl-f and find each edited section.
This only took an hour or so to complete, using the keyword to search for changes. If I discover any further issues, I will refer back to the log of code edits.
Scratch card prize issue
When the player gets two pairs on a scratch card, the game awards the lowest prize value. This seems wrong to me, and the player should be awarded the highest.
I fixed this by reversing the direction that the game searched through the fruit by value. This way the player should be awarded the prize with the greatest value.
I would like to say that this is done, but I would be irresponsible to just leave it without testing it. I’ve obviously ran it a few times now just to make sure it worked ok. But statistically, the chances of getting a pair of pairs is remote, and I have run out of daily prize cards. Because of this I have decided to edit the code so I can control the outcome.
I altered two lines to get the game working closer to how I wanted. I changed the line which selected the random fruit from random[0,9] to random[0,1] so only two possible fruits could be selected.
The second line was one to award myself an extra 10 game cards every time I run the app 😉 lol. I will be removing this line before the next test build is released.
Then all I had to do was play a few scratch cards until I got one with two pairs. Then see which prize it awarded me. It didn’t take too many turns until I found one, and I could verify the code worked properly now.
Upgrades Store Issue
This is one of the pain in the ass bugs which I have tried to look into before. There is a note on the Trello stating that I couldn’t reproduce the issue. This is from back in June when I last looked at it.
As you well know it is an awful lot harder to fix a bug if you cannot reproduce it.
Fortunately, I think I have managed to reproduce it this morning, which is nice. Lets hope this means I’m halfway towards fixing it!
Explaining the issue
The above picture is from the Upgrades store page. Each panel has an icon, an upgrade progress indicator, a line of text and a price with a coin icon.
For some reason, all of these seem to work perfectly except for the Self destruct one.
The line of text should only read Unlock when there are no yellow squares lit up. That is to say before the player purchases an upgrade for the first time.
Once the first upgrade has been purchased to unlock the item, the text should change to “upgrade” instead of “Unlock”, and the price should change.
However, as you can see in the image above, although its working ok for the Head start, it is not working as it’s intended for the self destruct powerup.
Neither the text nor the price has changed. The price is supposed to increase with each upgrade purchased.
To add to the confusion, once the Self destruct is fully upgraded, the price and the text do actually change. However, neither of the things it changes to are correct.
Oddly enough, filling in the yellow blocks seems to work correctly. My first stop was the UI script to see what happened when the button is pressed to buy an upgrade.
Fixing the issue
After a couple of hours of running the game, testing, reading code and repeating, I finally found the problem! (Although I did go for a 20 minute walk outside to get some air. I find it helps thinking and problem solving)
When I wrote this, I had actually copied and pasted the code handling each of the panels on this page. They are all virtually identical, with only a few minor differences.
Whilst doing this, I had apparently overlooked a variable. *sigh*
// Updates price if its not max level, otherwise clear price (and hide coin?) SetUpgradeText(upgrades.selfDestructUpgrade, ui, 64, "SELF DESTRUCT")
Instead of selfDestructUpgrade, the function was being passed the data for the headStartUpgrade instead. Since none of these values were changing, neither were the text or price being displayed!
At least it was a simple fix once I had spotted the error. 🙂
Bullet X Speed issue
Lastly, I looked at the bullet x speed issue bug.
When the Anti-aircraft guns shoot, their bullets seem to drift left, which was noticeable when playing the game.
After checking the maths to make sure I had the angles and Sin/Cos correct, I started to experiment with alternative solutions.
The first idea was to alter the angle of travel. Since the sprite was drawn in the correct angle, there was no need to rotate it. All I had to do was change the bulletDirection constant.
This seemed to fix the problem, although it took a while to determine the best angle to resolve the issue. I also had to adjust the spawn point of the bullets a little.
All that was left to do was leave a note on the trello card and slide it over to the under review column.
In the next update
So that leaves us with just two bugs or known issues to fix. There is still the discrepancy as to how distance is measured between different types of challenges, and the occasional stutter which seems to have appeared.
Hopefully I will be able to get these fixed for the next update, then it will be a case of running through the Under review column and ensuring that all the bugs are fixed and working as expected.
Then it will be on to phase 2! Which is where I add some extra detail to the game mechanics to increase the longevity of the gameplay, as well as some extra zones and skins for the scratch cards (Possibly)
And that’s all for now
But, for now it is getting close to 3pm so I should wrap this up and get the social media posts prepped and ready for posting.
I will as always be back in two weeks with the next update. 🙂