Math Defense or so

The hourglass ability sounds nice!
Take as much time as you need with the sprites :+1:

Iā€™ll start working on adding in the hourglass and updating the hearts item tomorrow, I probably wonā€™t get them done as quickly as the previous updates though, maybe 2 days or so. Also, since the position of the shop is expected to change, Iā€™ll try to make some edits to the last file I shared to prepare for that. I also prevented the user from placing items under the shop, should we keep that, or should we allow the user to place items anywhere in the map, even under the UI?

With all of these great abilities, I find the addition tank a bit useless (especially since multiplication tank deals double damage), so I was thinking if we should ā€œlockā€ some items in the shop, and have them unlock after the user reaches a specific level? For example, the multiplication tank unlocks after level 3 is completed, the hearts is after level 5, mines after level 7, hourglass after level 10, etcā€¦ (this is just an example)

This will not only force the users to start with the weaker tank and rise up from there, but itā€™ll also give them something to aim for, a goal. With that goal in mind, theyā€™ll have to come up with a strategy for how they want to pass the level with the tools they have while saving for the other unlocked tools.

I also feel like with the hourglass and hearts ability, if someone was to place too many of them over the map, then the game becomes too easy. Iā€™d like to suggest putting a limit somewhere hereā€¦ for example, the hourglass would have two equations, or you could only buy 4 hearts max, or something like that.

Edit: Maybe we could even limit how many of each item could be bought based on the levelā€¦ for example, you could buy 2 hearts max after level 5, and unlock more hearts in the shop every 5 levels (this is just an example). Same thing for hourglass and other items.

Also, just to make sure, would you like the hourglass ability to be something that you can place on the map?

Sorry for asking too many questions :sweat_smile:

1 Like

Affinity Designer 2.0

1 Like

Iā€™ll answer in a bit. Im from my cel, and I cant write.much.

1 Like

Everywhere, but not below UI.

Yup, that is the idea, initially we develop everything, then we do the level design. That part is still not designed. Also, I have plan for enemies to be different in behavior, but we can add those details later.

Also, do you still have code to do different paths? Iā€™ll also provide 2 to 3 more tile sets so we can change the scenes as you see in mario games. Example, first 3 levels could use these green tiles, then the next levels could use desert tileset, then ice tileset and so onā€¦ and for those we could design different enemy paths.

Well, in theory, do addition operation is easier than doing multiplication, so that is why it damage is only oneā€¦ also to balance that, the price is cheaper.

Yes, and also, by putting or introducing one tank at a time per level, it is better so people can learn how the game and tanks work.

Well, we will balance that when we do the level design, since the currency (money) would not be infinite. So they are forced to choose between aggressive or defensive.

Yes, also the hearts. (In green space)

2 Likes

Maybe in the future we could do similar games in 3Dā€¦ haha, but I just experimenting with this so I can do some kind of game title, but not as realistic as this oneā€¦

3 Likes

This took longer than it usually takes me since I started my summer courses, and I also had an annoying bug that lasted for some time, I ended up rewriting my code for that part this morning- and it all works now.

Iā€™d advise trying the wick file in the test editor.
It should still work in the regular editor, but there are some things that wonā€™t work there (ex: in test editor, you canā€™t place tanks/ items over UI but you can in regular editor).

Iā€™ve also added in the heart & hourglass items, and adjusted the UI to match the one in your design.

Also, in the outside right (only visible in editor) I added a text for testing purposes which displays tick, freeze, and time frozen, to help show how long the hourglass ā€œfreezing timeā€ effect lasts for.

Hereā€™s the Wick file:
Math Defense.wick (157.8 KB)

Yep, I still have that code (ā€œGameā€ layer => frame 1 => default script) so adding this in should be easy.


Changing the enemy path when tanks are already placed though might result in having the road go over the tanks, so should every time the map changes, the tanks get removed as well? (and player gets coins for how much the tanks were worth?)

1 Like

Ok, tomorrow Ill give you the sprites, at least what I got until now. Then, we can put this on the side until July, since I will not have access to the forums after some point next week until July.

1 Like

Here is so farā€¦
You can press play and see the animationsā€¦

NewSprites6-14-2023_22-02-44.wick (291.7 KB)

1 Like

I tried to add in the assets:

I changed the first few levels as well to make them a bit easier and to help introduce the enemy types one at a time. I also cleaned the code a bit in some spacesā€¦

On a side note, I was impressed when I realized that I was able to replace this equation

Math.ceil((tick/project.framerate)/s)*s===Math.floor((tick/project.framerate)/s)*s

with just

tick/project.framerate%s===0

And, as planned, I made items unlocked in the shop after a certain level is completed.
For now, hereā€™s what I set these levels to:

Completing level 3: Multiplication tank
Completing level 5: Road Mine
Completing level 7: Hearts
Completing level 10: Hourglass

Also, I wasnā€™t sure if there was any special font I needed to use for the text clips with the new assets, so I kept them in anton.
Math Defense.wick (398.1 KB)

After adding in the image files and coding everything, I felt like there was a difference in the FPS as the levels went on and you added in more items to the map.
Iā€™ve added in an FPS counter to test this out, you should be able to see it on the outside right side. Iā€™d like to know what FPS this project works at on your devices when you guys have time to check this out.

1 Like

It ran ok hereā€¦

The progress has been great! You are a great programmer. It has been fun working with you guys in this project!
Later on July Iā€™ll continue adding more details, feedback and sounds.

1 Like

I know why that could be happeningā€¦ I have noticed for wick editor that it is better (performance and memory wise) to clone individual clips when needed, rather than have a super clip with all the subclips inside.

Example:
You have a clip that contains all tanksā€¦ every time that you clone a multiplication one, you are cloning all of them at the same time in memory, but you donā€™t need all of them because a mult tank will not be converted into other tank in run time.

1 Like

Youā€™re right, this is slowing down the project. I tried dealing with this by deleting all frames of the clonesā€™ timeline that arenā€™t in perspective (for the tanks and the enemies), and I deployed around 30 enemies to test; the FPS was at a faster rate with the unnecessary frames deleted. I added a function for deleting unused frames in the main projectā€™s ā€œGameā€ layerā€™s first frameā€™s default script:

I could try to also separate the tanks and enemies into 9 different clips and add them in a different frame, and bring them in when needed- though Idk if thatā€™ll make much of a difference.

Math Defense.wick (398.2 KB)

This collab feels almost complete ā€“ or maybe weā€™ve been moving fast :thinking: It definitely helped that one person managed the code, in recent collabs Iā€™ve been in (like Forum Fighters) the code always got complicated because youā€™d have multiple people with different types of thinking working on it.

There are a few things that weā€™ll still need to decide at some point:

  • Level set-ups
  • What happens when the hearts run out
  • Starting menu (optional)
  • Earnings per level completion (current value: " Math.ceil(level/2) " )
  • How-to-play tutorial

(You donā€™t need to reply to this now, think of this as a checklist)

Sounds good :+1: Take your time with that, and lemme know if youā€™ll need help with any of it :four_leaf_clover:

2 Likes