My Third Game

Game Demo – My Third Game

Welcome to our Third Game. There are 10 videos in this course.

  1. See the basic game in action
  2. Note the use of variables
  3. Play the game at https://scratch.mit.edu/projects/237079563/

You only learn if you explore yourself!.  Just “spectating” won’t work!

Video #1 – Create City, Silo, Gun, Bullet, Enemy Sprites & Backdrop

  1. Name your project
  2. Right-click doesn’t always work — shift-click does
  3. Make city (green) and silo (blue) in paint editor
  4. Make gun using line tool
  5. Make bullet as white circle
  6. Make enemy as red circle
  7. Name the sprites
  8. Make background grey

You only learn if you explore yourself!.  Just “spectating” won’t work!

Video #2 – Setup Startup Scripts

Setup initial sprite sizes, position via scripts.

  1. Build City costumes that show it getting destroyed
  2. Build usual Setup script for City
  3. Build Silo script
  4. Build Gun script  need Forever loop so we can control its direction with the arrow keys (use “aimGun” and “fireGun” custom blocks
  5. Need “gunDirection” variable

You only learn if you explore yourself!.  Just “spectating” won’t work!

Video #3 – Work on Gun Script

  1. Build script for arrow keys
  2. Build script for firing using up arrow
  3. Broadcast message to Bullet to let it know it has been fired

You only learn if you explore yourself!.  Just “spectating” won’t work!

Video #4 – Bullet Script

Dealing with putting Gun, bullet, on top of Silo. What to do when receiving FireGun message.

  1. Accept message from gun
  2. Point direction to variable “gunDirection”
  3. Repeat until “hit edge”
  4. TEST IT —make sure you understand the logic!

You only learn if you explore yourself!.  Just “spectating” won’t work!

Video #5 – Enemy Sprite Code

Code blocks for the enemy bullet collision and when the enemy hits the city.

  1. Make our standard custom blocks
  2. Make “FireEnemy block
  3. Use random block for x position
  4. Point it towards the City
  5. TEST it.

You only learn if you explore yourself!.  Just “spectating” won’t work!

Video #6 – Bullet-Enemy Collision Code Blocks

  1. Make enemy disappear when hit by bullett
  2. Use hide and show carefully
  3. Test to make sure it all works

You only learn if you explore yourself!.  Just “spectating” won’t work!

Video #7 – Collision Custom Explode Block

One way to go “Boom” and show the explosion.

  1. Detect the collision in the bullet script
  2. Build explode logic (add sound for now)
  3. Add hit variable for scoring
  4. Test and Understand!

You only learn if you explore yourself!.  Just “spectating” won’t work!

Video #8 -Animate City Slow Destruction

Make separate costumes for hit by hit city destruction.

  1. Make Setup, Reset custom blocks for City sprite
  2. Use “When I receive HitCity” and add Animate block
  3. Use Go to Next Costume
  4. Stop after 5 hits

You only learn if you explore yourself!.  Just “spectating” won’t work!

Video #9 – “City Gone” Message. Backdrop Change & Code For Game End

Finish code & test to make sure it is doing what you really want it to do.

  1. Send message that City is gone
  2. Hide  — show how to copy scripts to other sprites
  3. Check to make restart works
  4. TEST

You only learn if you explore yourself!.  Just “spectating” won’t work!

Video #10 – Add Pen Down For Enemy, Show, Hide Blocks, Count Bullets Fired

Finish some details. Lots more that can be done. You’ve built good start to a neat game.

  1. Make a simple explosion in bullet script
  2. Add Pen to enemy sprite to show trail
  3. Clear graphics at end of each hit city or collision.
  4. Add “bulletsFired” variable.
  5. Add pen up pen down, and clear track when reset
    You only learn if you explore yourself!.  Just “spectating” won’t work!