Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#bitter-steenbok #363 Browser Games: Generic Platform Game #38

Open
wants to merge 42 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
39f32fd
Update README and add CONTRACT file
SomayaB May 2, 2017
98ce8d6
Create static file with HTML and CSS
SomayaB May 2, 2017
43186b9
Implement loop function
SomayaB May 2, 2017
300f68a
Add functions to draw x and o
SomayaB May 2, 2017
8711294
Complete player-vs-computer version
SomayaB May 4, 2017
aef4f32
Merge pull request #1 from SomayaB/tic-tac-toe
SomayaB May 4, 2017
bc768ea
Add html, css and js files
SomayaB May 4, 2017
dca56d7
WIP
SomayaB May 4, 2017
7185772
WIP2
SomayaB May 5, 2017
ea43140
Add more meaningful variable names
SomayaB May 5, 2017
e155b48
Merge pull request #2 from SomayaB/tic-tac-toe
SomayaB May 5, 2017
fc20c18
still working
SomayaB May 5, 2017
cba2fd4
Add Simon game functionality for 1 round
SomayaB May 5, 2017
f7dee92
Merge pull request #4 from SomayaB/simon
SomayaB May 5, 2017
40ee910
Add Platform Game CONTRACT file w/ specs
SomayaB May 15, 2017
c35b3c5
Need to merge to move on to new browser game
SomayaB May 15, 2017
4c19604
Initial commit, adds CONTRACT file, removes old browser games
SomayaB May 15, 2017
a8219c5
Adds platform.html file
SomayaB May 15, 2017
4bdc884
Adds levels and Level constructor
SomayaB May 15, 2017
683e585
Merge pull request #5 from SomayaB/levels
SomayaB May 15, 2017
1a4b576
Adds Actors contructor functions
SomayaB May 15, 2017
fe109e1
Merge pull request #6 from SomayaB/actors
SomayaB May 15, 2017
1ceab14
Adds DOMDisplay constructor and CSS styling
SomayaB May 16, 2017
d7ad572
Adds all drawing methods
SomayaB May 16, 2017
3c5d412
Merge pull request #7 from SomayaB/drawing
SomayaB May 16, 2017
d950d43
Adds methods to deal with collisions
SomayaB May 16, 2017
af75b55
Merge pull request #8 from SomayaB/motion-collision
SomayaB May 16, 2017
2bf8af1
Adds action methods for all actors
SomayaB May 16, 2017
9502e05
Merge pull request #9 from SomayaB/actors-actions
SomayaB May 16, 2017
7a1f5a1
Adds method to track keypress as long as they are pressed
SomayaB May 16, 2017
a15662c
Merge pull request #10 from SomayaB/tracking-keys
SomayaB May 16, 2017
7642366
Adds runAnimation, runLevel and runGame functions
SomayaB May 16, 2017
52d2a72
Merge pull request #11 from SomayaB/running-game
SomayaB May 16, 2017
7c57e53
Implement lives to the runGame function
SomayaB May 16, 2017
f8d4f3a
Merge pull request #12 from SomayaB/lives
SomayaB May 16, 2017
88e2189
Adds pausing functionality to the runLevel function
SomayaB May 16, 2017
cc1f209
Merge pull request #13 from SomayaB/pausing
SomayaB May 16, 2017
0d5373a
Adds game instructions
SomayaB May 16, 2017
ac6623f
Seperates game logic from levels
SomayaB May 16, 2017
311ecfd
Cleans code and spacing
SomayaB May 16, 2017
ea1581e
Checks of last spec box
SomayaB May 16, 2017
d0c450e
Merge pull request #14 from SomayaB/clean-up
SomayaB May 16, 2017
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
72 changes: 72 additions & 0 deletions CONTRACT_Platform-Game.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#bitter-steenbok
## Somaya Bounouar
#363 Browser Games: Generic Platform Game
http://jsdev.learnersguild.org/goals/363-Browser_Games-Platform.html
Specs are in the CONTRACT file.

# Browser Games: Generic Platform Game

## Challenge Rating

This goal will likely be within your ZPD if you...

- Can build basic web sites with HTML & CSS
- Can add behavior to a web site with JavaScript
- Are familiar with DOM manipulation
- Are familiar with platform-based games
- Are interested in making more complex interactive web pages

## Description

Implement a simple [platform](https://en.wikipedia.org/wiki/Platform_game) ("run and jump") game with HTML, CSS, and JavaScript.

Follow [this tutorial](http://eloquentjavascript.net/15_game.html) from [Eloquent JavaScript](http://eloquentjavascript.net/).

Fork the the [browser-games repository][browser-games] and use the fork as your project artifact.

Implement the **Platform** game from the list in the [games.md][games-list] file.

![platform-game](http://eloquentjavascript.net/img/darkblue.png)

## Context

This goal will challenge your ability to take a _formal, defined system_ from the real world and replicate it in code. You will start with all of the logic of the system (the rules of the game) and most of the UI already designed.

Your work will be mainly in deciding how to replicate that formal logic and user interface using only JavaScript, HTML, and CSS.

## Specifications

#### General

- [x] Artifact produced is a fork of the [browser-games][browser-games] repo.
- [x] Variables, functions, files, etc. have appropriate and meaningful names.
- [x] HTML, CSS, and JS files are well formatted with proper spacing and indentation.
- [x] There is a clear separation of game logic code from view/rendering code.
- [x] All major features are added via pull requests with a clear description and concise commit messages.
- [x] The artifact produced is properly licensed, preferably with the [MIT license][mit-license].

#### Generic Platform Game

- [x] Game can be found at `public/platform.html`
- [x] Game is playable by one player
- [x] Game follows rules established in [tutorial](http://eloquentjavascript.net/15_game.html)
- [x] Game page is linked from `public/index.html`

### Stretch

Design and build your own platform-like game. What else can you build with the techniques you came up with in building the Generic Platform Game?

- [ ] Game has its own HTML, CSS, and JS
- [ ] Game is playable
- [ ] Game page is linked from `public/index.html`

## Resources

- MDN: [Introduction to the DOM](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model/Introduction) #html #dom #js
- MDN: [Guide to Event Handlers](https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Event_handlers) #dom #js
- Shay Howe: [Learn to Code HTML & CSS](http://learn.shayhowe.com/html-css/) #html #css
- Tutorial: [Project: A Platform Game](http://eloquentjavascript.net/15_game.html) #js #html #dom

[browser-games]: https://github.com/GuildCrafts/browser-games
[games-list]: https://github.com/GuildCrafts/browser-games/blob/master/games.md
[mit-license]: https://opensource.org/licenses/MIT
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#bitter-steenbok
## Somaya Bounouar
#363 Browser Games: Generic Platform Game
http://jsdev.learnersguild.org/goals/363-Browser_Games-Platform.html

# Browser Games

A collection of games to play in a web browser. See the full list of games in the [games.md](games.md) file.
Expand Down
43 changes: 43 additions & 0 deletions public/css/platform.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
.background {
background: rgb(52, 166, 251);
table-layout: fixed;
border-spacing: 0;
}
.background td {
padding: 0;
}
.lava {
background: rgb(255, 100, 100);
}
.wall {
background: white;
}

.actor { position: absolute; }
.coin { background: rgb(241, 229, 89); }
.player { background: rgb(64, 64, 64); }

.lost .player {
background: rgb(160, 64, 64);
}
.won .player {
box-shadow: -4px -7px 8px white, 4px -7px 8px white;
}

.game {
overflow: hidden;
max-width: 600px;
max-height: 450px;
position: relative;
}

#status {
font-family: futura, arial;
font-weight: bold;
color: #152055;
}

#instructions {
font-family: futura, arial;
color: #152055;
}
4 changes: 1 addition & 3 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ <h1>Browser Games</h1>

<nav>
<ul>
<li><a>LINK TO FIRST GAME</a></li>
<li><a>LINK TO SECOND GAME</a></li>
<li>...</li>
<li><a href="platform.html">Platform Game</a></li>
</ul>
</nav>
</body>
Expand Down
137 changes: 137 additions & 0 deletions public/js/GAME_LEVELS.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading