Hey, @richard the mini memu doesn’t seem to show for me
I don’t want to reveal the game here’s the code
every time I overlap with the tile and press A it doesn’t do anything. Could help mega please.
Hey, @richard the mini memu doesn’t seem to show for me
I don’t want to reveal the game here’s the code
Try putting a stay in screen block for the menu that’s what I do.
If my way isn’t the right way to do it somebody tell me.
It worked thank you very much
@CopySprite instead of stay in screen, you want to turn on “relative to camera”. that will prevent the sprite from being affected by the camera.
it’s in the dropdown of this block:
Thank you.
Is there a way to set the menu items as all the values stored in an array like for an inventory?
there are two versions of the create menu sprite block and the second one takes in an array.
the easiest way to do this would be to make an empty array and then loop over all of your inventory items and push a menu item into the empty array for each one. then you can create the menu sprite out of your constructed array of values.
I’m back … again, but this time with more of a question than a problem.
Is there a way I can make different options appear if a condition is met or is the only way to do that is by making like 100+ menu types?
@Not-a-creepy-doll underneath the first create menu block there is one that takes in an array instead. you can conditionally add or remove things from the menu by building up an array of menu items.
here’s an example game that conditionally controls what appears in the menu:
This worked wonders thank you
(i see you liking all my post ms. president… what’s going on here? )
@richard How do I make a menu like this:
If the options is selected, the is unable to choose again.
AND ALSO I STILL DON’T UNDERSTAND HOW TO INCREASE FPS IN THE GAME, CAN SOMEONE PLEASE GIVE ME A TUTORIAL OR INSTRUCTIONS OF HOW TO DO IT!? thx
@BlueYoshi507 like this?
improving FPS is a tricky question… FPS is tied to your computer and how efficient your code is (it will be different for every game). if you share your program, i can try and give you some specific things you can try
When a project gets laggy, I usually go around disabling bits and bobs here and there until my project gets smoother, which is how I find why the project is laggy.
Fixing it is another issue. Sometimes it’s something as simple as “Oh look! This codes sets an image to be exactly the same as it already was, repeatedly, in an on game update block! Guess I’d better change that lol”
Other times it’s not so simple.
The first thing I always look at is the fps monitor in the in-game menu. This will show you if the game starts up already laggy, or if some action causes lag to build up, like spawning a bunch of sprites that never get deleted when they go off screen (that’s a common one ).
If you can identify which thing, or stack of things, is making your code laggy, it’s usually fairly simple to fix!
@richard Here’s my code!
You will see the new updates I made for it!
@BlueYoshi507 are you referring to the FPS of the blocks editor or the game? I’m not seeing any issues when playing your game in the browser.
@richard The Game. After I put like 2 rows of plants, the fps of the game start slowly going down and down until… EXTREME LAG!
hmmm, i’m still getting pretty good FPS with lots of plants:
but anyways i still see some parts of your code that can be optimized.
let’s take a look at your on game update; you have a lot of code that you are running every frame for every sprite of several sprite kinds. for example, let’s look at this chunk:
this code definitely does not need to be looping over every plant each frame. instead, consider setting the grabbing plant
variable inside your button pressed and released events. also, store whatever plant is being grabbed in a variable so that you don’t need to loop over all of them to find which sprite you need to set the position on. then inside your on game update
you can replace that code with something that looks like this:
alright, next up is this chunk of code:
definitely doesn’t need to happen every frame! instead, consider making an “on sun amount changed” function that you call every time you change the sun amount
variable and put this code inside. you would also need to call that code wherever you set the On?
property
finally, let’s look at this code:
you only need to set these animations when you create the enemy sprite. not every frame
@richard can I use a “Forever” instead of a “Game Update” block?
@BlueYoshi507 why do you want to use a forever block?
@richard To always make those block work, but not make it happen every frame. I notice that the “Forever” has some mini-pauses (instead of every frame) when it’s working, so I though that maybe it could make the game have a better performance.