create a game with different levels?
4 posts • Page 1 of 1
create a game with different levels?
Is it possible in Algodoo to crerate a scene with a "goal", e.g. destroy the red start.
Once the goal is reached, a new scene should be started.
This way a game can be vreated consisting of different levels (a serious game consisting of different lessons...)
Martijn
Once the goal is reached, a new scene should be started.
This way a game can be vreated consisting of different levels (a serious game consisting of different lessons...)
Martijn
- spook1
- Posts: 20
- Joined: Thu Sep 10, 2009 12:06 am
Re: create a game with different levels?
An easy way to accomplish what you want is to use the function scene.open
replace "myscene" with whatever the name if the next level is. Put that script into the end goal, such as a red block.
- Code: Select all
scene.open("myscene.phz")
replace "myscene" with whatever the name if the next level is. Put that script into the end goal, such as a red block.
-
standardtoaster - Posts: 606
- Joined: Mon Aug 31, 2009 7:57 pm
Re: create a game with different levels?
But then they would need to have the other scenes for it to work Which doesn't favor for online use.
The most common level system i've seen is the camera pan. For example you would have the first level in the bottom right corner of the sandbox then have the seconds level in the bottom left corner.
This would put the camera 5 clicks to the right.
this would put the camera 5 clicks up.
Negative numbers work the same way in the opposite direction.
Its best to toy around with it until you get the position you like
It also doesn't hurt the change zoom
150 is the default zoom setting
Once again its best to toy around with it to get the position you want.
To put this into oncollide its quite simple
The most common level system i've seen is the camera pan. For example you would have the first level in the bottom right corner of the sandbox then have the seconds level in the bottom left corner.
- Code: Select all
Scene.Camera.Pan = [5,0]
This would put the camera 5 clicks to the right.
- Code: Select all
Scene.Camera.Pan = [0,5]
this would put the camera 5 clicks up.
Negative numbers work the same way in the opposite direction.
Its best to toy around with it until you get the position you like
It also doesn't hurt the change zoom
- Code: Select all
scene.camera.zoom = 150
150 is the default zoom setting
Once again its best to toy around with it to get the position you want.
To put this into oncollide its quite simple
- Code: Select all
(e)=>{Scene.Camera.Pan = [0,0]; scene.camera.zoom = 150}
-
Mystery - Posts: 2802
- Joined: Thu Sep 03, 2009 1:16 pm
- Location: Southern Australia
Re: create a game with different levels?
Yes, i did exactly that with my Simple Physics scenes, you can look at them to see it in action!
-
Versieon - Posts: 375
- Joined: Tue Sep 01, 2009 4:45 pm
4 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 15 guests