Skip to content

Commit 1d0f0d4

Browse files
committed
Small tweaks to instructions.
1 parent 5265d9e commit 1d0f0d4

File tree

3 files changed

+31
-12
lines changed

3 files changed

+31
-12
lines changed

index.html

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,10 @@
7777
<div>
7878
<h1>Tutorials</h1>
7979
<ul>
80-
<li><a href="index.html?tutorial=tutorial-hello-world.html">Hello World</a></li>
81-
<li><a href="index.html?tutorial=tutorial-collisions-many-to-one.html">Collisions: Many to One</a></li>
82-
<li><a href="index.html?tutorial=tutorial-traveling-at-light-speed.html">Traveling at Light Speed</a></li>
83-
<li><a href="index.html?tutorial=tutorial-primitives.html">Primitives</a></li>
84-
<li><a href="index.html?tutorial=tutorial-animation.html">Animation</a></li>
80+
<li><a href="index.html?tutorial=tutorial-primitives.html">Rendering Primitives</a></li>
81+
<li><a href="index.html?tutorial=tutorial-animation.html">Animating Sprites</a></li>
8582
<li><a href="index.html?tutorial=tutorial-arcade-shooter.html">Arcade Shooter</a></li>
83+
<li><a href="index.html?tutorial=tutorial-traveling-at-light-speed.html">Traveling at Light Speed</a></li>
8684
</ul>
8785
</div>
8886
</div>

tutorial-animation.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ <h1>Non-looping animation</h1>
7272
args.state.starting_tick = args.state.tick_count
7373
end
7474

75+
args.outputs.labels << [80, 1.from_top,
76+
"press space to animate",
77+
-7.5,
78+
1]
79+
7580
number_of_sprites = 7
7681
number_of_frames_per_sprite = 6
7782
does_animation_loop = false
@@ -137,6 +142,18 @@ <h1>Animating from Sprite Sheets</h1>
137142
tile_w: 32,
138143
tile_h: 32,
139144
}
145+
146+
args.outputs.labels << [80, 22,
147+
"(contents of png)",
148+
-7.5, 1]
149+
150+
args.outputs.sprites << {
151+
x: 24,
152+
y: 0,
153+
h: 16,
154+
w: 112,
155+
path: 'sprites/explosion-sheet.png'
156+
}
140157
end
141158

142159
$gtk.reset
@@ -177,6 +194,11 @@ <h1>Non-looping Animation from a Sprite Sheet</h1>
177194
tile_w: 32,
178195
tile_h: 32,
179196
}
197+
198+
args.outputs.labels << [80, 1.from_top,
199+
"press space to animate",
200+
-7.5,
201+
1]
180202
end
181203

182204
$gtk.reset

tutorial-arcade-shooter.html

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ <h1>DragonRuby Game Toolkit - Arcade Shooter</h1>
1111
<div itemscope="itemscope" itemtype="tutorial-step" data-step-number="1">
1212
<div itemscope="itemscope" itemtype="tutorial-text">
1313
<h1>Moveable Player</h1>
14-
<p>We can start by creating a moveable player</p>
14+
<p>We can start by creating a moveable player. Use the arrow keys to move around.</p>
1515
</div>
1616
<div itemscope="itemscope" itemtype="tutorial-code">
1717
<pre>
@@ -69,8 +69,7 @@ <h1>Moveable Player</h1>
6969
<div itemscope="itemscope" itemtype="tutorial-step" data-step-number="2">
7070
<div itemscope="itemscope" itemtype="tutorial-text">
7171
<h1>Player Shooting</h1>
72-
Next, we will add player shooting.
73-
The label shows the number of bullets that exist.
72+
Next, we will add player shooting. Press space to shoot. The label shows the number of bullets that exist.
7473
</div>
7574
<div itemscope="itemscope" itemtype="tutorial-code">
7675
<pre>
@@ -111,7 +110,7 @@ <h1>Player Shooting</h1>
111110

112111
# Shows how many bullets are being rendered
113112
args.outputs.labels << [
114-
10, 20, player.bullets.size
113+
5, 5.from_top, "bullet count: #{player.bullets.size}", -7.5
115114
]
116115
end
117116

@@ -140,7 +139,7 @@ <h1>Player Shooting</h1>
140139
player.y -= player.speed if args.inputs.keyboard.down
141140

142141
# If the space bar is pressed and lifted
143-
if args.inputs.keyboard.key_up.space
142+
if args.inputs.keyboard.key_down.space
144143
# Add a bullet sprite to player.bullets
145144
player.bullets << [
146145
# Centers the bullet on the center of the player
@@ -414,7 +413,7 @@ <h1>Bringing it all together</h1>
414413
player.y += player.speed if args.inputs.keyboard.up
415414
player.y -= player.speed if args.inputs.keyboard.down
416415

417-
if args.inputs.keyboard.key_up.space
416+
if args.inputs.keyboard.key_down.space
418417
player.bullets << [
419418
player.x + player.w / 2 - player.bullet_size / 2,
420419
player.y + player.h / 2 - player.bullet_size / 2,
@@ -603,7 +602,7 @@ <h1>Adding collisions</h1>
603602
player.y += player.speed if args.inputs.keyboard.up
604603
player.y -= player.speed if args.inputs.keyboard.down
605604

606-
if args.inputs.keyboard.key_up.space
605+
if args.inputs.keyboard.key_down.space
607606
player.bullets << [
608607
player.x + player.w / 2 - player.bullet_size / 2,
609608
player.y + player.h / 2 - player.bullet_size / 2,

0 commit comments

Comments
 (0)