Giter VIP home page Giter VIP logo

not-pacman's Introduction

Not Pacman

This is the first "larger" p5 project we're working on. The idea is to put KeyedUpBall, KeyListener, BouncyBall, and Timer together into a working game.

There are three "dailies" this week. Actually, these aren't separate assignments, but rather steps on the way to the spec.

1. Detect collisions

You must write a detectCollision() function in KeyedUpBall which returns true when the KeyedUpBall has collided with a BouncyBall. Pass the BouncyBall as an argument; the return value should be true when they have collided or are overlapping, and false when they are not.

2. Delete BouncyBalls

You must devise a system for deleting BouncyBalls from the game. This will likely be accomplished using the Array.splie() function.

3. A Game object

In terms of design, you should put almost all of your attention into NotPacmanGame. I have included an empty object with the conventional initialize(), update(), and display() functions. You must not modify the code in the setup() and draw() functions in sketch.js, although (hint hint) you may wish there to introduce and modify a mouseClicked() function, which is invoked by p5.js whenever the mouse is clicked.

Specs

Here are the specifications for Not Pacman:

  • The game should start with a black screen with the head's up display showing a zero score and a time of 0:00.
  • When the user clicks on this blank screen, the game starts:
    • Twenty BouncyBalls appear at the center of the screen, radiating out in random directions
    • The KeyedUpBall appears at location of the mouse click
  • The KeyedUpBall moves according to the WASD controls
  • The BouncyBalls disappear whenever they collide with the KeyedUpBall
  • Each time a BouncyBall collides with the KeyedUpBall, the score increases by 1
  • As soon as there are no longer any BouncyBalls in the game, the game ends:
    • The KeyedUpBall disappears
    • The timer stops at its current reading (displaying how long it took to win)

not-pacman's People

Watchers

James Cloos avatar Scott Richmond 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.