So I’ve been working on this game called ‘‘go to tesco at night’’ and I need help implementing my ending. I want the player to be able to go to the old market stall / behind tesco and grab the carrot. After that, I would like the player to get the ending animation when they enter the microwave room.
Here’s the game: Flowlab Game Creator - Go to tesco at night
I just played the whole game (so far) and it was nice. I have 2 different solutions to your problem:
Idea 1
You could have a controller object of some sort that sits off-screen and is set to Keep Between Levels. When the carrot is collected, this object would receive a message from the carrot object that inputs a number into a Global value that goes into a Filter behavior. Set the Filter block to greater than 1 and connect whatever behavior leads to your ending.
Idea 2 (recommended)
An easier thing to do would be to delete all of the levels except the first one and then rebuild all of the other levels within the same level. Pros of this:
- Saves you precious free user levels for main menus or another game within the same game (or anything else really)
- The game is very small so you can put the whole thing in one level just fine
- Putting it all in one level means you don’t need complex Global stuff, and you can use the controller as a camera that uses the Position behavior to cut from place to place as a camera effect.
If you do this idea, rebuild all the levels with correct button positions in the same level. Instead of taking you to the previous or next level, the buttons move the camera to show the previous or next room/area. Finally, when the carrot is collected, make it send a message to the control object that triggers the ending once you click on the microwave. The ending could be either be another camera section in the same level, or it could be a separate level.
Here’s some code that JR01 showed me how to make which is basically an “if this is done, allow this to happen when that happens”:
Subsitute your code.
(Off topic post, was deleted.)
I’m allergic to dairy too, what’s your point? Also there is a special brand of cheese for dairy-allergic people like us: Violife. Their cheese is plant-based and I eat it with my burgers and sandwiches all the time. Violife has other non-dairy versions of dairy products too, like they have mayonnaise if I remember correctly.
What do you mean?
I advise against this unless you can really do some complex code connecting multiple objects. All you have to do for the 2nd solution is place your backgrounds in one level so that you can send the message to allow the animation to play only if you enter the living room with the carrot. You can’t send messages through levels unfortunately. You can still do the solution [1] if you want, I’m not gonna stop you, but I hope you understand both first.
You’re welcome.
Sorry! I should have been more clear. I didn’t read all of the first solution, so I’m sorry about that…
I actually tried to move the camera to different coordinates previously when I was making the game, but I thought it would be simpler to just use the method I’m using now, but clearly I was wrong…
I’m probably going to use solution 2 now, but that does mean I need to re-work alot of the game.
I am kind of unsure how to calculate where the camera should move to, so I end up just playing a guessing game, slowly narrowing down where the camera should move to.
Any hints on how I could make this process easier?
Is the camera on a separate object?
For a secret project team I’m apart of, I designed the camera to be on a separate object that moves its X and Y value based on where the players at.
If you wanted a transition or it to slowly slide into a specific part, you could just use the coordinates or use the in game grid layout and multiply each value by 32 to make it pixel scale instead of grid scale.