I’m sure you could use any sort of currency in a game. Coins are usually the most common.
I still have no idea what I’m doing
Intermediate Challenge
Sorry don’t feel like really doing this one and I’m short on time atm.
Basically just get the average between the X, then the Y. Now just add half of the screen size, something like that. I might update this later tonight after I get back, but I’ll probably forget about it lol
The expert challenege is technically correct but isnt the answer I was looking for. The challenge in general is “what is a better method than stacking a ton of if statments”. I should’ve added that it needs to evaluate math too.
Close, but the number wouldnt reset to what is was if you die and restart the level.
Oh. But does it have to reset to the number the player had when they started the level, or just all the way to 0?
To what the player had when first started the level.
Oh mann. WHY is this beginner.
You just need a couple more behaviors, its beginner because it just needs a few more steps to what most beginners make. Its a learning process and to help make a better coin system for anyone who has one in their games.
Not sure if this is the intended solution, but something like this is very easy to setup if you’re aware of it.
My Expert Challenge Solution
Switch cases are typically the best way to address using multiple if statements. They’re easier to read, write, and compute.
Switches check a value to see if it is equal to any case. The problem is that checking the expression variable wouldn’t be that useful since we’d have to account for every number in a range. (Imagine typing out a case for every number that “A” could be for everything less than 100. Hint: It’s not possible!) Pivoting our approach a little by using a Boolean check, we can see any time the imported variable is true and output accordingly.
The above code when pasted into an expression will output 1 when A is above 100, 2 when A is below it, and 3 when it is equal to it. These numbers and relations could be changed to whatever variables you needed to check and however you needed to check them.
January Challenge Answer
@CodeAlpaca @JUSTPLAINOP @Recryptech
Answers
Beginner Challenge: Coin Counter
A coin counter that resets on level restart, but saves on level progression.
Intermediate Challenge: 2 Subject Camera
This can be done 2 ways with the player (game world) and Mouse (UI) or with the player (game world) and another object like a goal or obective (game world).
Here’s a solution with the player and mouse:
Expression Challenge: No If Statements
So a better way to not only to organize your code, but also to optimize it is by using Switch cases. A switch case is like a list of options that is chosen by the value that goes in. A list like @CodeAlpaca solution is correct by technicality but it is not the most optimized because ALL the properties of a list is loaded into memory. This is also true for if statements, where both True and False statements can load of list of other statements when it could simply be loaded much quicker.
switch (A-1) {
case 0: A+B;
case 1: A-B;
case 2: A;
case 3: B;
default: 0;
}
wow that is quite a bit of code.
Really interesting
I love this series
honestly same.
2025 Monthly Challenge - February
Rules:
-
Do not use my code or my examples, I will know and will make adjustments to the challenge.
-
If you already have the code for the challenge, I request to make it from scratch.
-
The answer can be a game link or a screenshot (Win+Shift+S).
-
When posting an answer, please use the Hide Details function (in the gear icon).
-
-
[details="Answer"] Paste you answer here [/details]
-
Beginner Challenge:
“Point and Shoot”
Share a screenshot on how to make an object emit a bullet at the mouse cursor.
Intermediate Challenge:
“Staying on a Platform”
Using raycast behaviors, share a screenshot on how to make an enemy move and turn around whenever they approach the edge of the platform or ground they are walking on.
Expert Challenge:
“Calculate Zoom between 2 Objects”
Using the positions of 2 objects, calculate the zoom of the camera needed to keep them on screen. The camera should also stay between them too like a 2 subject camera, but that was done last months challenge and this challenge is only wanting the code and math needed to calculate the zoom.