Help on diver game

I am trying to make an adventure game where you play as this “diver”. I was planning on making it able to interact with other such as plants to collect them but my code won’t work when I tried it! I also tried to make a statue in which you can save your progress on but when it’s asked, you cant press A to answer yes. Can someone help me figure out what’s wrong and how to fix it?

4 Likes

For the harvesting animation, I think that deleting animations that is not so important could help. I have made a game and due to the amount of animations, some could not work.

2 Likes

Great art, I love the main characters animations!

For the plants interaction, these two parts of the code aren’t working together:

When you press the A button while on top of a plant it does trigger the event (you can try putting destroy sprite otherSprite in there to see it go away), but the animation isn’t showing up because the on game update is constantly resetting the image. You can add a boolean flag (like moving) that you start at the beginning of the animation and end at the end / after a 500ms pause, and then have the on game update image resetting’s if condition be if not moving and not collecting.

Worth a note, Richard has an extension in the works to try and make animations for moving / etc simpler to achieve: Animate vs Legacy in On Game Update

Re: Save point; these two portions aren’t working together:

when you create the statue, you clear out the tile, so that tile doesn’t exist anymore and you won’t ever overlap it. Also, you probably don’t want that ask save game? in a while loop; it will keep asking again immediately until the player says no, so it looks like nothing is happening. Instead, you can do:

4 Likes

Wow. Love the art so much.

2 Likes

Thank you! I got the save function to work but how would you add a boolean flag at the beginning and end of the animations?

Thank you! :heart:

1 Like

Yeah the art is very unique

2 Likes

The art is good

3 Likes

In this case, the event is happening in a sprite overlap event, which makes it a bit easier. Overlap events between two sprites happen outside the game loop, so you can put a pause in that event without breaking the game. So you can do something like this:

(this also makes it so they can’t move while picking stuff up)

In other events (e.g. sprite overlaps with tiles) this likely won’t work as the code will run immediately / block other things from running. In that case, you would want to use something like richards arcade-story extension to queue up things that will run separately.

2 Likes

thank you!! i’ll be updating if there is any problems!

2 Likes

I can help.

2 Likes

thank you! I don’t need help now but later if I do then i’ll ask

1 Like

Because I realized I am going to make this game bigger and have many(?) tilemaps, instead of using if statements to insert the location like before, I thought of using arrays of locations with the tilemap extension.
The thing is, I don’t know arrays that well and I don’t know how to make the code short while having many many tilemaps. Does anyone know what to do?

1 Like

Can I maybe help?

Yes please

1 Like

Just male a few and put that it will show random tilemaps.

1 Like

Do you possibly mean make?

1 Like

The letter “K” and letter “L” are right next to each other. That’s why

2 Likes

Make i mean

3 Likes

Yeah but how would the code be short? cause I don’t want the tilemaps to be random

2 Likes