Help in creating a balloon pop game that can switch to a different level (screen)

Hi, I need help in fixing some problems in my app, I am trying to create a app in which you pop different balloons that appear on your screen, I used the pop a balloon game tutorial for it and then incorporated the @Anke switch screen method, but now I am facing a new problem in which how i can show the button to go to the next level after the user loses in the game (it appears after they lose because there is no limit for points and the game will go on for forever).
New (1).aia (581.5 KB)
This is my app aia above. Thanks and please help me.

If you are asking for help, I recommend you to make it as easy for others to be able to help you ...
You probably will get more feedback then...

which means in your case post a screenshot of your relevant blocks...

To download the aia file, upload it to App Inventor, open it, do some bug hunting for you, etc... this takes time, and most people will not do that...
Thank you.

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

I cleaned up your code using Any Component blocks, along with your UI.
I added a button that moves the user to the next screen, which appears once the game ends (when the ImageSprite.EdgeReached event is triggered).
I did not understand why the TinyDB was there (unless it was to save the current screen?).

New_1.aia (575.8 KB)

Hi Nishyanth, I appreciate your help, but was there a need to get rid of all of the blocks in screen 2, becasue screen 2 was initially the level 2 of my game. I also saw that you got rid of the restart button for screen 1, was this necessary, becasue now the user won't be able to restart level 1 (screen 1). As for the TinyDb, I added that since it was in @Anke switch screens correctly method, but if it is unnecessary then I can delete it. But overall thanks for your help, very much appreciated.
New_1.aia (575.8 KB)
The upgraded version from you.

I didn't see it as necessary, sorry (in hindsight, I have no idea why). All you have to do is make the restart and next screen Buttons invisible when you click it, and enable the clock. Also make sure to make the restart Button visible when the game ends.

Is this what you meant for me to do?


If not can you please elaborate more on it, FYI I am a beginner so I do not understand most things. I added the button1.Visible and Button2.Visible. Thanks

Yes, this is correct. Make sure you set Button2.Visible to False in the Button1.Click event.

I did what you told me to do and now I am facing this error when i try to use the ai companion or the apk.
ERROR: appinventor/ai_prabhnoor_otal979/New_1/Screen2.yail line 399: duplicate declaration of 'Button1$Click'

ERROR: appinventor/ai_prabhnoor_otal979/New_1/Screen2.yail line 399: (this is the previous declaration of 'Button1$Click')

ERROR: appinventor/ai_prabhnoor_otal979/New_1/Screen2.yail line 410: duplicate declaration of 'Clock1$Timer'

ERROR: appinventor/ai_prabhnoor_otal979/New_1/Screen2.yail line 410: (this is the previous declaration of 'Clock1$Timer')

[GenerateClasses] ERROR: Can't find class file for Screen 'Screen2'
[GenerateClasses] Task errored in 2.725 seconds

This is what I did:


Pls Help me.

Look in Screen2 for duplicate of Clock1.Timer and Button1.Click

A Cleanup Blocks might help find them..

If that does not work,

(Canned Reply: ABG- Export & Upload .aia)
Export your .aia file and upload it here.

export_and_upload_aia

.

You cannot have two event handlers that listen to the same thing. Merge the blocks inside the two event blocks (for each event) and delete the duplicate event handlers.

Thanks for the help, I did what you told me and fixed that problem. :slight_smile:

Hi ABG, I have encountered another problem in which now the second screen of my level does not work properly, could you help me to fix this please.
New_1 (1).aia (561.2 KB)
This is the game aia.

Exactly what did you expect to happen versus what is actually happening?

Are you referring to Screen2?

These look wrong:


(empty socket)


(generic event that does not single out the sprite in question)

This was done by NishyanthKumar, I have no idea what this does.

In screen 2 I wanted the balloons to appear and fall down and when they reached the edge the balloons will disappear and the restart button and Go to previous level button should appear. But this did not happen. There is no need to fix the balloon part anymore since I fixed it but the Restart Button and the Go to Previous level button still don't show up (this is for screen 2).

As for the second image you showed, I did some tinkering to it and reduced the imageSprite from 10 to 5. Here is how it looks like now.


New_1 (2).aia (559.4 KB)

You left them invisible in the Designer for Screen2, and you never make them Visible in Screen2.Initialize.

By the way, you could line them up in a Horizontal Arrangement to add some vertical space for your Canvas.

So, you mean for me to do this?

Try it.

2 Likes

Thanks So Much, It works now!!!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.