Slightly later than planned...
Let me start off by apologising for missing last fortnights entry here.
I had planned on having the challenges working by the end of the week, but it was a much larger task than I had originally thought, and unfortunately real life got in the way slightly and I ended up with a bunch half finished code and nothing new to show for it. (It turned out it was actually working, the only thing stopping it was the bit where I had written a function, but then forgotten to call it, *facepalm*)
This time round however, all of the framework for the challenges is now in place.
The challenge data is loaded in with the level file. The data used is simply a challenge ID and a target value.
Each game loop the challenges are checked in a function which uses a SELECT block to determine the conditions to pass the challenge. So far there is only 1 challenge working, which is the score challenge, firstly because 3/5’s of each level is the Bronze, Silver and Gold score challenges, and secondly because it was quite simple to do 😊 lol
There will be other challenges done soon, things like achieving a snake of a certain length will be straight forward enough, but others like eating 5 bonus balls, or Greed – Eating n balls while the bonus is on screen, or chasing your tail – form an unbroken loop with your snake will require extra variables and coding.
The other bit of programming necessary for the challenges was the Message box system, to announce to the player that they had passed the challenge.
Once the Player succeeds in a challenge, a message is added to the queue. I’ve used a queueing system because it’s possible to complete 2 or more challenges at a time, and this way the player is notified of each one in turn.
Each game loop a function checks on the current state of the message box, if it’s not displaying a message then it checks the queue for a message and displays it, if it is displaying a message it checks to see if it’s time has expired, in which case it switches to the third state, which is the fade out. Once it’s faded to nothingness the state is set to not displaying.
To create the visual aspects of the message box, I simply repurposed the sprite and text objects which are used for the “Prepare to launch” and “Game over” messages.
Here’s a video showing the challenges and message box in action…
Also this week I have been working on progressing from the Game Over message, and returning back to the menu to allow the player to play again. This is quite an important bit to implement before the beta testing can go ahead.
Currently the explosion continues until you tap the screen, but there is no text indicating this. I may change the pause button image to a >> (like a fast forward button); Once tapped the explosion clears and the menu returns.
It took a while to ensure that all of the text, objects,
variables etc. were resetting back to their default values. But I think I got there in the end 😊
Talking of explosions, I’ve also taken the opportunity to update the old 2d particle explosion using AGK’s 3D particles (Which hadn’t been added when I originally wrote the explosion code). The picture below is from my first attempt at configuring the particle emitter.
It took a bit of fiddling around, but fortunately the 2D and 3D commands are fairly similar and I think it’s looking pretty good (even if I do say so myself, lol).
The other new update to the current build is the colours on the radar. It is now much easier to tell which is Snake, Wall, Egg or Bonus ball with a glance at the radar.
And there we have it, I’ll be back next fortnight when, hopefully, I’ll have gotten more of the UI working, as well as more challenges and possibly even the Mines!
It’s slow progress, but it’s getting there 😊
See you next time
Leave a comment
Log in with itch.io to leave a comment.