Endless screen
murat.sogukcesme
Member, PRO Posts: 37
in Help Wanted
Hey there,
I need some help with making a "Vertical Endless Screen" in GameSalad. I want the display with active spawned actors, which left and right with random velocities move, let come down. This spawned actors should thereafter have to move again from top to bottom. Background remains unchanged, only the spawned actors actually go from top to bottom and come back and do the same and again the same. They should also move from left to right and vice versa to go.
I appreciate it very much if I can get help with this.
Thanks,
Murat
Comments
The basics of it would be to spawn your actor at the top above the screen/scene, put a behavior on them to move down (there's a number of different type of move behaviors) and then have a rule on the actor to say once the self.Position.Y < 0 then change the self.Position.Y to be a high number again (above the scene). Make the rule check for less than 0 if you want the whole actor to go off screen before it moves back to the top. Something like this:
If self.Position.Y < 0
..Change Attribute: self.Position.Y = 768.
Play around with the numbers to get the actor disappear and re-appear at the right positions you want. Less than 0 would mean it would disappear once half of the actor is off the screen. If you want the whole actor to scroll off the screen before it goes back to the top then say something like this:
If self.Position.Y < -(self.Size.Height / 2)
..Change Attribute: self.Position.Y = 768 + (self.Size.Height / 2)
If you search on you tube there are video tutorials on how to do this..... You need a good repeating background to start.
Thank you very much KevinCross, I go to try it today in the evening (live in Holland ) I hope it's going easily to finish my job.
@gattoman, I did it many times, but didn't work yet. It's a bit different cause I didn't see something with the same function what I want.
A free doodle jump template was posted years ago, maybe that will help?
http://forums.gamesalad.com/discussion/18053/free-doodle-jump-template-toastkitten
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
@Jamie, thanks for the zipfile, but unfortunately it doesn't have the .gsproj file to open it in Windows. Is it possible to send this again, but then with .gsproj file for windows GameSalad?
I tried really everything but it won't work. It's going now from left to right with given x/y positions, but I wan't this to spawn from up to down, and from left to right and right to left, if the blocks arriving the downside/bottom of the screen, then it have to be spawning again from the up-screen.
@ KevinCross, unfortunately it didn't worked yet, but I think it's not going together with the other behaviors what I selected already.
I put an attachment at this comment, maybe one of you can setup the right behaviors and rules that I need. I really appreciate the comments of your all.
I'll see if I can look at your example later, or just throw something together for you.
Thank KevinCross, I appreciate that
Is this what you're after?
If so I think you can do away with the rules completely and just set Wrap X and Wrap Y to true. This can be found under "Inspector > Scene"
Yep, this does exactly the same thing without any rules to check the position of the actors.
You will need to add the code to spawn the actors where you want them. I placed them in fixed positions in both of these examples
Thank you,
It's going to the right side Kevin
It's actually not exactly what I mean. The zipfile what I send to you, those blocks have to be going like I did, but the blocks have then to come to the downside. As example "Flappy Bird". The screen with random heigts of the pipes comes from right to the left in horizontal screen. But the spawned actors what I made, must be like that (swipes from left to rigth or right to the left), it have to be com above Y-568 to down and must come again from the up to down, like a waterfall.
Sorry for if my English is bad
But isn't the principle the same? You want an actor to scroll from one side to another or from top to bottom or vice versa etc. If you want to spawn a different size actor each time it scrolls off the screen then destroy it like you are and then spawn a new actor. Your initial project looked like it was doing this (although it wasn't changing sizes etc.) Your project destroyed an actor when it hits the wall and then spawns another.
If you don't want a wall and you want it to come from all directions then use the same rules as my first project but instead of moving the actor to the opposite side again, spawn a new actor and then destroy the other i.e.:
If self.Position.X < -(self.Size.Width / 2)
.. Spawn Actor at the opposite side of the screen.
.. Destroy
Hey there KevinCross, sorry for my late response. I was a few days out of the country. I tried what you wrote here, but what I actually mean is that I want the same block moving from left to right and from right to left. But the same blocks has to move at the same time from up to down. It must be beginning from above Y=568,all of the blocks must going both horizontally and vertically and then comes again and again.
So it looks like endless screen, but actually the player actor and the spawned actors are moving then.
I hope I'm not bothering with my comments