Editing
Gamebridge/Trigger Tutorial
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Part 2: Coin & World Components == === More Ways To Make Your First Level Fun === Now that you have a basic platforming game level that you can jump around in and try not to fall off the edge, it is time to make your level exciting and fun. # '''Make your lava red''' ## In '''Project''' panel, click '''Assets'''. ## Click '''Create''' and click '''Material'''. ## Type the name "'''LavaMaterial'''" and hit return. ## In the '''Inspector''' panel, there's a white box to the right of '''Main Color'''. Click it. ## In the '''Color''' panel that pops up, pick a reddish color and close the Color panel. ## In '''Project''' panel, drag the LavaMaterial into the '''Hierarchy''' panel to drop it on the '''Lava '''object. # '''Expand your game level''' ## Make 10 cube platforms and position them with gaps so that you have to jump between the cubes. ## Arrange the cube gaps at increasing distances and difficulties until the last couple jumps are quite difficult but not impossible for you. ## Make sure that you always get teleported back to the start if you fall from anywhere in the level. # # '''Make a portal that teleports between two levels.''' ## Make a vertical wide narrow cube that looks like a door. (2.0, 3.0, 0.5 scale) ## Set it to IsTrigger = true (checked). ## Duplicate the Teleport.js script. ## Rename the duplicate script Portal.js. ## Attach Portal.js to the door by dragging it onto the object or its name in the Hierarchy list part of the window. ## Double click Portal.js. ## Add a new line at the top that reads "var levelToLoad : String = "level2"; ## Replace "level1" with levelToLoad.<br> Your code should look like this:<br> <br> var levelToLoad : String = "level2";<br> function OnTriggerEnter( other : Collider ) {<br> Application.LoadLevel( levelToLoad ); <br> }<br> ## '''Make level2 so your portal has somewhere to go:''' ### '''File Menu / New Scene'''. ### '''File menu / Save''' the scene as '''"level2"'''. ### Repeat steps 1-9 to make yourself a new level with a new or duplicate '''"level1"''' as a starting template and rename the duplicate '''"level2"'''. ### Make sure the name of the second level matches the name referred to in the '''Portal.js''' script. ### Add each of the levels in your game to the Build Settings list by clicking '''File Menu / Build Settings...''' and clicking''' Add Current '''after loading each one'''.''' ### Load the first level again. ### Play and walk into the first door. ### If it takes you to the first level again, congrats! ### '''Make the door white:''' #### In '''Project''' Panel, click '''Create''' / '''Material'''. #### I ## # The expanded Telport script which can go between levels or reload the same level: #pragma strict<br> var levelToLoad : String = "";<br> var reload : boolean = false;<br> function OnTriggerEnter ( other : Collider ) {<br> if ( reload )<br> {<br> Application.LoadLevel(Application.loadedLevel);<br> }<br> if ( levelToLoad != "" )<br> {<br> Application.LoadLevel(levelToLoad);<br> }<br> } Once you expand your level with more cubes for walls and jumping plus a portal to the next level, it might look like something like this: [[Image:platformingCubes.png]]
Summary:
Please note that all contributions to Noisebridge are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
Noisebridge:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Request account
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Dig in!
Noisebridge
Status: MOVED
Donate
About
Accessibility
Vision
Blog
MANUAL
Visitors
Participation
Community Standards
Channels
Operations
EVENTS
GUILDS
Meta
Electronics
Fabrication
Games
Music
Library
Neuro
Philosophy
Funding
Art
Crypto
DOCUMENTATION
Recent Changes
Random Page
Help
Categories
Edit
Tools
What links here
Related changes
Special pages
Page information