Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
113 changes: 38 additions & 75 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,96 +1,59 @@
# Project Name (Start editing here)
# <img src="/assets/img/lives.png" width="100"> Help Halimah Make Yishun Great Again
<!---
Read Me Contents
-->

# ![](https://ga-dash.s3.amazonaws.com/production/assets/logo-9f88ae6c9c3871690e33280fcf557f33.png) Project #1: The Game

### Overview

Let's start out with something fun - **a game!**

Everyone will get a chance to **be creative**, and work through some really **tough programming challenges** – since you've already gotten your feet wet with Tic Tac Toe, it's up to you to come up with a fun and interesting game to build.

**You will be working individually for this project**, but we'll be guiding you along the process and helping as you go. Show us what you've got!


---

### Technical Requirements

Your app must:

* **Render a game in the browser**
* **Any number of players** will be okay, switch turns will be great
* **Design logic for winning** & **visually display which player won**
* **Include separate HTML / CSS / JavaScript files**
* Stick with **KISS (Keep It Simple Stupid)** and **DRY (Don't Repeat Yourself)** principles
* Use **Javascript** for **DOM manipulation**, jQuery is not compulsory
* **Deploy your game online**, where the rest of the world can access it
* Use **semantic markup** for HTML and CSS (adhere to best practices)
* **No canvas** project will be accepted, only HTML5 + CSS3 + JS please
* <a href="https://charlimxm.github.io/project-1/">
Try playing here</a>

---

### Necessary Deliverables

* A **working game, built by you**, hosted somewhere on the internet
* A **link to your hosted working game** in the URL section of your GitHub repo
* A **git repository hosted on GitHub**, with a link to your hosted game, and frequent commits dating back to the very beginning of the project
* **A ``readme.md`` file** with explanations of the technologies used, the approach taken, installation instructions, unsolved problems, etc.

---

### Suggested Ways to Get Started

* **Break the project down into different components** (data, presentation, views, style, DOM manipulation) and brainstorm each component individually. Use whiteboards!
* **Use your Development Tools** (console.log, inspector, alert statements, etc) to debug and solve problems
* Work through the lessons in class & ask questions when you need to! Think about adding relevant code to your game each night, instead of, you know... _procrastinating_.
* **Commit early, commit often.** Don’t be afraid to break something because you can always go back in time to a previous version.
* **Consult documentation resources** (MDN, jQuery, etc.) at home to better understand what you’ll be getting into.
* **Don’t be afraid to write code that you know you will have to remove later.** Create temporary elements (buttons, links, etc) that trigger events if real data is not available. For example, if you’re trying to figure out how to change some text when the game is over but you haven’t solved the win/lose game logic, you can create a button to simulate that until then.

---

### Potential Project Ideas

##### Blackjack
Make a one player game where people down on their luck can lose all their money by guessing which card the computer will deal next!
### Overview
In the recent spate of bad news, Yishun was named home to one of Singapore's most dystopian societies. Not all is bad when it was revealed that newly elected President, Mdm Halimah Yacob is a Yishunite (short for people who resides in Yishun).

##### Self-scoring Trivia
Test your wits & knowledge with whatever-the-heck you know about (so you can actually win). Guess answers, have the computer tell you how right you are!
Can you help Halimah help to reclaim Yishun’s disastrous reputation?

---
### Game Mechanics and Logic

### Useful Resources
Inspired by Brick Breaker, "Help Halimah Make Yishun Great Again" requires the player to clear the "bad people" who have been plaguing Yishun by deflecting a bouncing heart.

* **[MDN Javascript Docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript)** _(a great reference for all things Vanilla Javascript)_
* **[jQuery Docs](http://api.jquery.com)** _(if you're using jQuery)_
* **[GitHub Pages](https://pages.github.com)** _(for hosting your game)_
* **[How to write readme - Markdown CheatSheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet)** _(for editing this readme)_
* **[How to write a good readme for github repo!](https://gist.github.com/PurpleBooth/109311bb0361f32d87a2)** _(to make it better)_
<img src="/assets/img/game-ss.png" width="1200">

---
Below is a flowchart showing the game's instructions.

### Project Feedback + Evaluation
<img src="/assets/img/game-flowchart.png" width="1100">

* __Project Workflow__: Did you complete the user stories, wireframes, task tracking, and/or ERDs, as specified above? Did you use source control as expected for the phase of the program you’re in (detailed above)?
In order to create the game, the following depicts the main functions/ logics used:

* __Technical Requirements__: Did you deliver a project that met all the technical requirements? Given what the class has covered so far, did you build something that was reasonably complex?
* Spawning of random bad people icons
- create an array of objects with the bad people's images and their respectively scores
- randomised its sequence using Math.random()
- randomised its position using Math.random() and setting the maximum and minimum width and height so that the icons will only spawn within the map

* __Creativity__: Did you add a personal spin or creative element into your project submission? Did you deliver something of value to the end user (not just a login button and an index page)?
* Moving of paddle
- create an event to identify the keys pressed by tracking their keyCodes
- the keyCodes to be tracked here are 37 and 39 for the left and right arrow respectively
- when the left arrow key is pressed, the paddle will move to the right by 45px
- when the right arrow key is pressed, the paddle will move to the left by 45px
- create a similar event to track when the keys are released so that the paddle would stop moving

* __Code Quality__: Did you follow code style guidance and best practices covered in class, such as spacing, modularity, and semantic naming? Did you comment your code as your instructors have in class?
* Moving of heart and collision detections between the following pairs by checking if the positions of the two objects/ elements overlap.
- heart and paddle
- heart and walls (top, left and right)
- heart and bottom walls
- heart and "bad people"

* __Deployment__: Did you deploy your application to a public url using GitHub Pages?
### Built With
* HTML
* CSS
* JavaScript
* Jquery

* __Total__: Your instructors will give you a total score on your project between:
### Challenges
* Due to time and knowledge constraints, the author's had to abandon her initial plan of spawning the "bad people" only within the boundary of the Yishun map

Score | Expectations
----- | ------------
**0** | _Incomplete._
**1** | _Does not meet expectations._
**2** | _Meets expectations, good job!_
**3** | _Exceeds expectations, you wonderful creature, you!_
<img src="/assets/img/challenges-1.png" width="1100">

This will serve as a helpful overall gauge of whether you met the project goals, but __the more important scores are the individual ones__ above, which can help you identify where to focus your efforts for the next project!
### Acknowledgments
* <a href="https://developer.mozilla.org/en-US/docs/Games/Tutorials/2D_Breakout_game_pure_JavaScript">
MDN web docs - 2D breakout game using pure JavaScript</a>
Binary file added assets/.DS_Store
Binary file not shown.
179 changes: 179 additions & 0 deletions assets/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
.body {
height: 100%;
width: 100%;
margin: 0;
}

.container {
/*border: 1px solid blue;*/
width: 100%;
height: 850px;
margin: 0 auto;
}

h1 {
text-align: center;
margin: 0;
}

.instruction {
border: 1px solid black;
width: 18%;
height: 93%;
float: left;
background-color: #06D6A0;
}

.icon {
padding: 0;
margin: 0;
}

#p3 {
padding: 1px;
text-align: justify;
margin-bottom: 5px;
margin-left: 20px;
margin-right: 10px;
}

.results {
border: 1px solid black;
width: 18%;
height: 93%;
float: left;
background-color: #FFD166;
}

.level, .mission, .lives, .score {
font-size: 25px;
margin-left: 10px;
margin-right: 15px;
}

.halimah-lives {
width: 18%;
right: 18px;
bottom: 25px;
position: absolute;
}

.gameColumn, .start-screen, .finish-screen {
border: 1px solid black;
width: 63%;
height: 93%;
float: left;
position: relative;
}

.gameColumn {
background-image: url(../img/yishun-map.png);
background-size: 70%;
background-repeat: no-repeat;
background-position: 50% 0;
}

.badPeople {
width: 50px;
position: absolute;
margin: 0 auto;
}

.heart {
height: 19px;
width: 19px;
margin: 0 10px;
bottom: 30px;
left: 505px;
position: absolute;
background-color: red;
display: inline-block;
transform: rotate(-45deg);
}

.heart:before,
.heart:after {
content: "";
height: 19px;
width: 19px;
position: absolute;
background-color: red;
border-radius: 50%;
}

.heart:before {
top: -11px;
left: 0;
}

.heart:after {
left: 11px;
top: 0;
}

.paddle {
/*border: 1px solid blue;*/
width: 150px;
height: 25px;
left: 450px;
bottom: 0px;
position: absolute;
background-color: black;
}

.start-screen {
font-size: 40px;
text-align: center;
background-color: white;
}

.start-screen li {
padding: 10px;
font-size: 27px;
text-align: justify;
margin: 0 70px;
}

.arrow-keys {
width: 30%;
margin: 0 auto;
display: block;
}

.start-btn {
width: 20%;
font-size: 35px;
bottom: 80px;
position: relative;
}

.finish-screen {
font-size: 40px;
text-align: center;
color: white;
background-color: black;
}

.finish-screen h1 {
font-size: 70px;
color: white;
top: 35px;
left: 38%;
padding: 10px;
display: block;
}

.finish-screen p {
font-size: 50px;
color: white;
top: 90px;
left: 36%;
padding: 10px;
display: block;
}

.end-btn {
width: 10%;
font-size: 35px;
bottom: 80px;
}
Empty file removed assets/css/stylesheet.css
Empty file.
Binary file added assets/img/.DS_Store
Binary file not shown.
Binary file added assets/img/arrow-keys.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/bike-thef.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/brothel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/challenges-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/drug-dealer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/game-flowchart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/game-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/game-ss.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/injured-cat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/laughing.mp3
Binary file not shown.
Binary file added assets/img/lives.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/murderer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/restart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/start.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/yishun-map-no-bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/yishun-map-no-bg2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/yishun-map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/yishun-map0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading