The y coordinate not necessarily is 1...
Use the edge parameter instead... from the documentation Drawing and Animation
Edge here is represented as an integer that indicates one of eight directions north(1), northeast(2), east(3), southeast(4), south (-1), southwest(-2), west(-3), and northwest(-4).
Btw. what should happen, if another edge is reached?
You want something to happen when the airplane sprite reaches the top of the screen in portrait mode? See 17-12 in the above link.
Instead of switching Screens, consider switching Canvas. See example where Canvas1 is your main screen and Canvas2 is your Germany screen. Your game might work more simply and reliable using virtual Screens. Something like this might work for you
Even if do y to = 0 it will work out.
but the issue is, when switching from screen1 to screen2 anything alright.
but when switching from screen2 to screen instead of waiting until the image-sprite(airplane) reached the vertical edge y in the case it immediately switches from to screen4(as it already reached the vertical edge).
Another issue when reached to the last screen sometimes it starts again randomly showing screens(normally it should not do that since we closed those screen in the past and we never did call them.)
If i am not clear enough there is the aia file run it once and you will see what i mean.
That was my plan B instead of switching the screen to switch the canvas as you said.
But what is confusing me why are the screens even we called the event handler "close screen" still open when it reaches to the last screen sometimes it starts showing me again screen 3/4/5.(like as the never were closed) {in the last screen we do not call again the screens we just want how message that game is finished}.
And when i did install the unfinished app on my phone it crashed(cause of the memory consumption and properly some other issue cause it was necessary to restart the phone so i could use it again).
and your issues with switching screens are gone
from the first screenshot if another edge is reached you are opening screen Germany without closing the current screen...
my guess is in the end this crashes the app, because too many screens are open at the same time without closing the old screens, see also tip 1 here
I will try to do the work around, cause i thought more screen the code would look more clean.(since it shows less codes block)
But a question if "close screen" does not close the current screen witch function does it?
Since i thought when the function "close screen" is used the current screen(screen1) will be closed and only screen2(Germany will show up and would be the only one active).
You violated one of the prime rules of app development, assigning different data to different screens. Different screens are meant for different actions using different purposes.
I tried to open your project on the code AI2 server, and it failed to respond to screen switching requests in a timely fashion.
I uploaded your project to the Kodular Unchive tool (see image for URL) and got
I tried like suggest her to do single screen with multiply canvas's.
It did work for two canvas's as soon i insert the third one it does not do what it should.
What my intentions are:
Start the Information game >> press ready >> show the notifier >> Invisible the first screen(home screen) >Show canvas one (CanvasUSA) and when the player gets to the edge, then show another notifier (or similar) that tells a little bit about US history and the moves on to the next canvas. When it collides with the object to show the history of the object and restarts the information game).>>> invisible the previous canvas> and each time when the next canvas shows up add +1 object that plane can collide(to make it harder).(this would be repeated until we would have 5 canvas).