@@ -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