Coder Social home page Coder Social logo

botsvsaliens's Introduction

Bots vs Aliens: A Lesson on IF Statements

This game was made as part of the TAG Lesson (Session 3 for Javascript After School Lesson).

Learning Objectives:

  • Students will learn about String and boolean Variables

  • Students will learn how an basic if statement works

This game also contributes to the goal of building a collection of working demo games that will encourage students to start hacking/breaking/ and making these games their own.

Game Objective

This a pretty straight rip off of Plants Vs Aliens with the exception that the Plants (or Bots in this case) are movable.

The object of the game is to use the bots to shoot down aliens before they pass the left side of the screen and 'enter the base'. There are three waves of aliens.

Lesson Objectives

The game starts with three active bots. Each bot has a unique weapon. As part of the lesson, student will equip two additional bots by changing their equip status from true to false

Furthermore, students can rename their bots with better names.

Bot equipment and name section

    //--------- Bot 1 ----------//
    bot1_equip = true;
    bot1_name = "None Bot1";
    //--------- Bot 2 ----------//
    bot2_equip = true;
    bot2_name = "Null Bot2";
    //--------- Bot 3 ----------//
    bot3_equip = true;
    bot3_name = "Zilth Bot3";
    //--------- Bot 4 ----------//
    bot4_equip = false;
    bot4_name = "Nada Bot4";
    //--------- Bot 5 ----------//
    bot5_equip = false;
    bot5_name = "Nope Bot5";

Controls

When the instructor first boots the game there are three equipped bots (Bot 1, Bot 2, and Bot 3).

Bot 1 controls are S Key = Shoot W Key = Up X Key = Down

Bot 2 Controls are the same, but one key over, so E Key = Shoot W Key = Up X Key = Down

The controls (even for the unequipped bots) continue in the pattern down the keyboard.

Pro Tip: Have the students reset the controls how ever they like by changing the movement function for each bot. For example the update function for bot2 are:

    // -- Update Functions --
    /// bot2_shoot()
    /// bot2_up()
    /// bot2_down()

Playing / Modifying the Game

The code is designed to be manipulated in the Fiddler.js editor. This web based editor is available on DCPS computers.

If not in the classroom or on DCPS computers, It is suggested to Brackets IDE for development or any local server for testing and development.

To play the base game, you can find it here: https://rectheworld.github.io/botsvsaliens/

Built With

  • Phaser.js 2.6.2

Contributing

Alien sprites are done by TAG artist Charlotte Lesson and code contributions from @Notserk

License

This project is licensed under the MIT License - see the LICENSE.md file for details

botsvsaliens's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.