Trying to change to next level
eddysparks
Member Posts: 24
Im useing the asteroids template and trying to make it so when you destroyed all asteroids, you move on to another level with more asteroids. I thought it would be sumfin simple as adding CHANGE SCENE to the Win rule. But it changes the scene but does not start as a new level and does not allow to spawn a new ship. Can someone point me to what i have to do?
Comments
You should also create a global game attribute (integer) and call it "score" (or you could create one called "enemyshipsdestroyed" see below)
Create a rule within that actor prototype, when game.score=5,000 then change scene to "scene 2"
You can create different types of global attributes depending on what it is you want the player to accomplish in each level
You could create one called "enemyshipsdestroyed" and make it integer
Make sure you place a rule within the enemy ship that each time it's destroyed, add change attribute, game.enemyshipsdestroyed to game.enemyshipsdestroyed+1
(Each time a player destroys an enemy ship, it adds 1 to that attribute.)
Then you could create a rule within the invisible actor that, when enemyships destroyed =20, change scene to... Scene 2
You need to have an attribute stating what goal it is you want your player to accomplish before moving to the next level...
Also, make sure you place the actor prototype somewhere on the scene and make sure you make it invisible using the color icon and dragging it to 0% so the player can't see that box.
Hope this helps!
So each time a ship is destroyed, create a rule within that enemy ship that Game.Shipsdestroyed = Game.Shipsdestroyed+1
Then within another actor prototype (make it invisible and you can name it "change scene"), create a rule:
When game.Shipsdestroyed=12, Timer, after 3 seconds, Change Scene to "Scene 2"
You can also within that invisible actor prototype say, You Win! Timer, after 3 seconds, change to scene 2 etc...
Also, within that same invisible actor "change scene" you can also place other rules in there, like if the player dies, then display text: Game over, and reset the game or go back to initial scene
Hope this helps!
CUBE!!!
Don't worry mate, we all start somewhere, and the templates are as good a place as any.
Once I'd grasped a few of the basics I never went back to them, but they're invaluable to new people trying things out.
Why not try and make a game 'from scratch', without the template? Look at the behaviours - they're self explanatory most of the time, and when they're not, they have little notes that tell you what they do.
Seriously, you'll learn a lot just from mucking about
Good luck!
CUUUUUUBE!!!!
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
http://www.gamesalad.com/landing/contact
i've published a rule i use to change scenes. hopefully it will help you.
http://docs.google.com/View?id=dcrvmt6h_59dnzzdrcc
the key parts to pay attention to are the rules at the top, and the scene behavior at the bottom. that pretty much does it all. all the variables are just stuff i wanted reset to certain values if you go back to the start of the game.
hope it helps.
noodles...
Thanks everyone for your help.
updated game http://gamesalad.com/game/play/13224
So if you are an artist and you are drawing speed lines on a fast moving car for a flipbook, you keep adding one speed line until you have enough. Then you go to the next page to draw speed lines on the next image.
Rule: When mouse button down
--Spawn Actor: Speed line
--Change Attribute: game.totalSpeedLines = game.totalSpeedLines + 1
Rule: When game. totalSpeedLines ≥ 12
--Change Attribute: game.totalSpeedLines = 0 (because the new page has no speed lines)
--Change Scene: nextPage
Next issue is if i loose all 3 lives i made it so i goes back to start screen, but then on first level you still get the 'YOU LOOSE' text on level 1. I'm not seeing big obvious thing. I thought maybe using the reset Scene, or reset game but they dont seem to do anything.
Somewhere between changing scene and entering the new scene, you need a Change Attribute behavior on the 'Player On Screen?' game attribute to be false.
http://gamesalad.com/game/play/13224
Scene spawns player, player dies 3 times, wen player lives reach zero, action activates to change to start of game. Plaer lives still zero becos no action to say its 3 again?
http://www.gamesalad.com/game/play/13224;jsessionid=7BF62726B0FAD2F77FE04F252E80E3CD
The over all game attribute starts with 'Enemies On Screen 4' which means thats how each level (scene) will start, with 4. So what happens if i want 4 enemies on Level 1, then 6 enemies on level 2? how can i change the 'Enemies On Screen' attribute according to the level (scene)?
Double check what the conditions of your rules have, Use the Display Text behavior to show the value of any attributes you may be checking.
I appreciate the effort to help me with this though.
Im just a little frustrated now, and perhaps should have a cup of tea
It's somewhat like trying to change a lego sculpture into a different one after it's been built. There's layers and interlocking pieces that, unless you know the reasoning and dependencies in the structure as well as the fundamentals of lego construction, make it difficult to change it into something else if you are still a novice. It'd be much easier to carefully study the original, decide what you need or don't need, then build your own from scratch. Then you know full well what a specific piece (behavior, attribute, rule, etc.) does and how it can be used.
So my suggestion to you is to take what you've absorbed about GameSalad from playing around with the template, and start an empty project your own way. If the logic for keeping track of lives or restarting a level do not make sense, then create it in a way that does. Start from the bottom and build your game piece by piece. GameSalad will not remove the need to think of how things are put together, however it will make the act of putting them together much easier.
That said, we will continue improving our templates and creating tutorials in the future that help new users understand how they were built. In the meantime, continue working with CodeMonkey and the rest of the community and I'm sure you'll be a pro in no time!
If you need help, my twitter account is butterbean_21 I'll see what I can help you with, just direct message me, or send me a message through gamesalad messaging system, you'll get there, you're already doing a great job with your game, and you've just started out