If layout existsForum Home > Construct 2 General > How do I....?
|Post Reply||Page <12|
|Post Options Quote Reply Posted: 21 Mar 2012 at 5:24pm|
Zephlon, I found that with Parallax layers you have to check off the box that says Show in Editor. Then move them over in the preview. It might be easier to move them in place with events than using layers?
|Post Options Quote Reply Posted: 10 Apr 2012 at 4:26pm|
My first game is almost ready, all levels are finished (after almost 2 months of tough work), the only thing i need to do now are the menus... if someone can show me the basics how to make a menu like on Poggle game, i need all levels to be visible in the menu but they need to be locked as in Poggle, than after the first level is finished the second to be unlocked and so on.
i guess Zephlon can answer me :), by the way, your game is very addictive hihi.
|Post Options Quote Reply Posted: 10 Apr 2012 at 8:11pm|
The basic idea is that, at the end of a level, you store the highscore in a database of some kind (I used the WebStorage object). Then you create a sprite on the level select menu with one animation for unlocked, and one for locked. Then at the start of the layout you iterate through all of the levels and if the previous level has a highscore greater than zero, unlock it.
I can explain in more detail, but I'll need to know if you want the menu to be automatically generated and if you want multiple pages.
|Post Options Quote Reply Posted: 11 Apr 2012 at 11:09am|
Hey, please check this capx. this is how far i can get... you`ll just need to add some events to help me.
|Post Options Quote Reply Posted: 12 Apr 2012 at 3:55am|
First, you can have more than one layout share the same event sheet. Second, each of the level boxes should be multiple instances of the same object. (Create the first one, name it, and then move it while holding ctrl to copy. Or, right-click>copy, then right-click>paste.) To have multiple frames for one object, open the first one, create a new frame (right-click in the frames window, click add frame), make sure the new frame is selected, and open the next image.
Does your game keep track of score? If not, we'll need to do this differently; because this is like a level select menu and high-score system in one.
|Post Options Quote Reply Posted: 14 Apr 2012 at 12:07pm|
Thanks for the help, but the problem is that all my levels are done in a different events, cause every level have different variables like, health, time limit is different every level. Tried to do it this way like you have shown me, but cant do it, i guess it is because the different events, if you have any suggestions, please tell if not i guess i`ll have to think hard :).
|Post Options Quote Reply Posted: 14 Apr 2012 at 5:07pm|
You can have the variables that are different attached to an object (like the player). Just click on the object, go to properties, and click "Add/Edit Instance Variables". Then if there isn't anything else different, delete all of the event sheets but one (except for the menu events) and make sure all of the levels point to the same event sheet.
|Post Options Quote Reply Posted: 17 Apr 2012 at 12:27pm|
Thanks for the help, but i find some other solution, i took 10 different sprites, one for every level, then add few events like
system.every tick - set opacity to 40 for all level boxes in the menu.
Then i added few events on every level.
When level 1 is finished - add 1 to "unlock level2" (global variable)
Again in the menu events i added,
If Unlock level2 = 1 - then set level 2 opacity opacity to 100% and
On levelbox2 clicked, and -
levelbox2 opacity is 100% - system go to level 2
and so on for every level.
Thanks for the help again
|Post Options Quote Reply Posted: 17 Apr 2012 at 7:04pm|
That would work, but it won't save the player's progress. So if the player closed the game and reopened it, he would be back at level 1.
Also, it is not a good idea to have multiple copies of the same event sheet. Even if some of the variables have different values.
It is better not to repeat the same instructions over and over, but instead to say it once and put variable where it's different.
Instead, you should do something like this:
Make one sprite object, name it levelbox. Right-click on it, choose add/edit instance variables, click the green plus sign, name the variable level and give it a type of text, click ok, and close the add/edit instance variables window. Hold ctrl and move the levelbox. This copies it. Do this until you have enough for each level. Edit each one to have the name of one of the levels (layouts) in the level instance variable (you can find it in the properties). If you don't want to type the name out each time, you can copy something like "Level " to the clipboard and paste that into the textbox then type the number. Example: Click levelbox, click the box next to "Instance Variables, level", press Ctrl+V, type "1", click the next levelbox, click the box next to "Instance Variables, level", press Ctrl+V, type "2", etc.
-- Menu Events --
system.every tick -> set opacity to 40 for all level boxes in the menu.
Declare Local Variable unlock_level = 1
System - For Each levelbox
If unlock_level = 1 -> then set levelbox opacity to 100%
(Event with no conditions) -> System > set variable unlock_level to WebStore.getLocalKey(levelbox.level)
On levelbox clicked, and -
levelbox opacity is 100% -> system go to levelbox.level
-- Game Events --
When a level is finished -> WebStorage > Set Local Key > LayoutName to 1.
|Post Options Quote Reply Posted: 18 Apr 2012 at 10:06am|
Well my game is already finished and i need to change everything to make it like you said, everything in one game event sheet, but definitely i will use you advice in some future projects.
BTW i placed save and load option http://www.scirra.com/forum/webstorage save-game_topic46118_post288827.html in the game for saving levels.
Only thing left to do is high score, you can check this if you can help somehow.
|Post Reply||Page <12|
|Forum Jump||Forum Permissions
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum