Construct2 Indie Game Development

advertisement
Go to your
Event Sheet
Click to Add Event
Select
“Monster”
then
Next!
Select
“Compare instance variable”
then
Next!
Enter:
• Comparison: ≤ Less or equal
• Value = 0
Done!
Click to Add Action
Select
“Monster”
then
Next!
Select
“Spawn another object”
then
Next!
<click to choose>
Select
“Explosion”
then
OK!
Enter:
• Layer = 1
• Image point = 0
Done!
Click to Add Action
Select
“Monster”
then
Next!
Select
“Destroy”
then
Done!
Right-click,
then click
Add global variable
Enter:
• Name: Score
• Type: Number
• Initial value: 0
• Description (optional)
• Constant?
OK!
Scroll to the top
to see it!
Scroll back
to the bottom
Click Add action
Select
“System”
then
Next!
Select
“Add to”
then
Next!
Enter:
• Value = 1
Done!
Click
Layers
Add a
new layer
(plus sign)
Right-click
then
click Rename
Change
the name
to “HUD”
Let’s update
the Parallax
values…
When the
background layers
scroll separately
http://wakeupandcode.com/c2/parallax.html
Source: Super Mario Bros, from Nintendo
Set the HUD’s
Parallax to
0, 0
Right-click
top left
of Layout 1
then
Insert new object
Select
“Text”
then
Click Insert
Click to place
Text object
(HUD layer)
Notice
Text
object
Change Properties
• Font
• Style: Bold Italic
• Size: 24
• Color: Yellow
quote
text
space
quote
"Score: " & Score
String
&
(ampersand)
Variable
"Score: " & Score
displays
Score: 100
For System,
Every tick
Click
Add action
Select
“Text”
then
Next!
Select
“text”
then
Next!
Enter:
• “Score: “ & Score
Done!
Click to Add Event
Select
“System”
then
Next!
Select
“Every X seconds”
then
Next!
Enter:
• Interval (seconds): 3
Done!
Click to Add Action
Select
“System”
then
Next!
Select
“Create object”
then
Next!
<click to choose>
Select
“Monster”
then
OK!
Enter:
• Layer = 1
• X = 1400
• Y = random(1024)
Done!
Click to Add Event
Select
“Monster”
then
Next!
Select
“On collision with another object”
then
Next!
<click to choose>
Select
“Player”
then
OK!
Done!
Click to Add Action
Select
“Player”
then
Next!
Select
“Destroy”
then
Done!
Online: http://www.scirra.com/tutorials
Forum: https://www.scirra.com/forum/
FB: https://www.facebook.com/groups/construct2devs/
Email: shchowd@microsoft.com  Twitter: @shahedC
Download