├── .gitignore
├── App42-all-3.1.min.js
├── assets
├── favicons
│ ├── android-chrome-192x192.png
│ ├── android-chrome-256x256.png
│ ├── apple-touch-icon.png
│ ├── browserconfig.xml
│ ├── favicon-16x16.png
│ ├── favicon-32x32.png
│ ├── favicon.ico
│ ├── manifest.json
│ ├── mstile-150x150.png
│ └── mstile-310x310.png
├── img
│ ├── arrow.png
│ ├── big-green.png
│ ├── big-red.png
│ ├── checkscore-button.png
│ ├── compass_rose.png
│ ├── faller.png
│ ├── game-background.png
│ ├── hardmode-button.png
│ ├── lava.png
│ ├── lava2.png
│ ├── loadscore-button.png
│ ├── menu-background.png
│ ├── mobile_direction.png
│ ├── mobile_jump.png
│ ├── monster1.png
│ ├── monster2.png
│ ├── mute-button.png
│ ├── og_meta.png
│ ├── particle-red.png
│ ├── particle.png
│ ├── particle2.png
│ ├── platform.png
│ ├── platform2.png
│ ├── raider.png
│ ├── rain.png
│ ├── restart-button.png
│ ├── sendscore-button.png
│ ├── tnt.png
│ ├── touch.png
│ ├── touch_segment.png
│ ├── tower1.png
│ ├── trampoline.png
│ └── underground-background.png
├── js
│ ├── phaser-touch-control.js
│ └── phaser.min.js
└── sound
│ ├── ding-end.mp3
│ ├── ding.mp3
│ ├── happy.mp3
│ ├── jump.mp3
│ ├── music.mp3
│ ├── rain.mp3
│ ├── scary1.mp3
│ ├── splash-death.mp3
│ ├── splash.mp3
│ ├── switch.mp3
│ ├── tnt.mp3
│ └── trampoline_jump.mp3
├── css
└── main.css
├── gulpfile.js
├── index.html
├── index.js
├── js
├── edit.js
├── game.js
├── gameState.js
├── levels
│ ├── index.js
│ ├── logic
│ │ ├── level01.js
│ │ ├── level02.js
│ │ ├── level03.js
│ │ ├── level04.js
│ │ ├── level05.js
│ │ ├── level06.js
│ │ ├── level07.js
│ │ ├── level08.js
│ │ ├── level09.js
│ │ ├── level10.js
│ │ ├── level11.js
│ │ ├── level12.js
│ │ ├── level13.js
│ │ ├── level14.js
│ │ ├── level15.js
│ │ ├── level16.js
│ │ └── levelPrototype.js
│ └── structures
│ │ ├── level01.js
│ │ ├── level02.js
│ │ ├── level03.js
│ │ ├── level04.js
│ │ ├── level05.js
│ │ ├── level06.js
│ │ ├── level07.js
│ │ ├── level08.js
│ │ ├── level09.js
│ │ ├── level10.js
│ │ ├── level11.js
│ │ ├── level12.js
│ │ ├── level13.js
│ │ ├── level14.js
│ │ ├── level15.js
│ │ ├── level16.js
│ │ └── levelStruct.js
├── states
│ ├── init.js
│ ├── menu.js
│ └── play.js
└── utils
│ ├── booster.js
│ ├── collisions.js
│ ├── emitters.js
│ ├── hardmode.js
│ └── tnt.js
├── old-prototype
├── assets
│ ├── arrow.png
│ ├── background.png
│ ├── background2.png
│ ├── die.mp3
│ ├── ding.mp3
│ ├── faller.png
│ ├── jump.mp3
│ ├── lava.png
│ ├── lava2.png
│ ├── menu.psd
│ ├── monster1.png
│ ├── monster2.png
│ ├── music.mp3
│ ├── music2.mp3
│ ├── particle.png
│ ├── particle2.png
│ ├── platform.png
│ ├── platform2.png
│ ├── rain.mp3
│ ├── rain.png
│ ├── red-particle.png
│ ├── splash-death.mp3
│ ├── splash.mp3
│ ├── tnt.mp3
│ ├── tnt.png
│ ├── tower1.png
│ ├── trampoline.png
│ └── trampoline_jump.mp3
├── index.html
├── js
│ ├── collisions.js
│ ├── game.js
│ ├── init.js
│ ├── levels
│ │ ├── level01.js
│ │ ├── level02.js
│ │ ├── level03.js
│ │ └── level_prototype.js
│ ├── menu.js
│ └── play.js
└── phaser.min.js
├── package.json
├── readme.md
└── server.js
/.gitignore:
--------------------------------------------------------------------------------
1 | mongoose-free-6.5.exe
2 | node_modules
3 | dist/js/app.js
4 | dist
5 | npm-debug.log
6 |
--------------------------------------------------------------------------------
/assets/favicons/android-chrome-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/favicons/android-chrome-192x192.png
--------------------------------------------------------------------------------
/assets/favicons/android-chrome-256x256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/favicons/android-chrome-256x256.png
--------------------------------------------------------------------------------
/assets/favicons/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/favicons/apple-touch-icon.png
--------------------------------------------------------------------------------
/assets/favicons/browserconfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | #00a300
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/assets/favicons/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/favicons/favicon-16x16.png
--------------------------------------------------------------------------------
/assets/favicons/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/favicons/favicon-32x32.png
--------------------------------------------------------------------------------
/assets/favicons/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/favicons/favicon.ico
--------------------------------------------------------------------------------
/assets/favicons/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Evil Slime City",
3 | "icons": [
4 | {
5 | "src": "assets/favicons/android-chrome-192x192.png",
6 | "sizes": "192x192",
7 | "type": "image/png"
8 | },
9 | {
10 | "src": "assets/favicons/android-chrome-256x256.png",
11 | "sizes": "256x256",
12 | "type": "image/png"
13 | }
14 | ],
15 | "theme_color": "#ffffff",
16 | "background_color": "#ffffff",
17 | "display": "standalone"
18 | }
--------------------------------------------------------------------------------
/assets/favicons/mstile-150x150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/favicons/mstile-150x150.png
--------------------------------------------------------------------------------
/assets/favicons/mstile-310x310.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/favicons/mstile-310x310.png
--------------------------------------------------------------------------------
/assets/img/arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/arrow.png
--------------------------------------------------------------------------------
/assets/img/big-green.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/big-green.png
--------------------------------------------------------------------------------
/assets/img/big-red.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/big-red.png
--------------------------------------------------------------------------------
/assets/img/checkscore-button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/checkscore-button.png
--------------------------------------------------------------------------------
/assets/img/compass_rose.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/compass_rose.png
--------------------------------------------------------------------------------
/assets/img/faller.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/faller.png
--------------------------------------------------------------------------------
/assets/img/game-background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/game-background.png
--------------------------------------------------------------------------------
/assets/img/hardmode-button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/hardmode-button.png
--------------------------------------------------------------------------------
/assets/img/lava.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/lava.png
--------------------------------------------------------------------------------
/assets/img/lava2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/lava2.png
--------------------------------------------------------------------------------
/assets/img/loadscore-button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/loadscore-button.png
--------------------------------------------------------------------------------
/assets/img/menu-background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/menu-background.png
--------------------------------------------------------------------------------
/assets/img/mobile_direction.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/mobile_direction.png
--------------------------------------------------------------------------------
/assets/img/mobile_jump.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/mobile_jump.png
--------------------------------------------------------------------------------
/assets/img/monster1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/monster1.png
--------------------------------------------------------------------------------
/assets/img/monster2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/monster2.png
--------------------------------------------------------------------------------
/assets/img/mute-button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/mute-button.png
--------------------------------------------------------------------------------
/assets/img/og_meta.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/og_meta.png
--------------------------------------------------------------------------------
/assets/img/particle-red.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/particle-red.png
--------------------------------------------------------------------------------
/assets/img/particle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/particle.png
--------------------------------------------------------------------------------
/assets/img/particle2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/particle2.png
--------------------------------------------------------------------------------
/assets/img/platform.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/platform.png
--------------------------------------------------------------------------------
/assets/img/platform2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/platform2.png
--------------------------------------------------------------------------------
/assets/img/raider.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/raider.png
--------------------------------------------------------------------------------
/assets/img/rain.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/rain.png
--------------------------------------------------------------------------------
/assets/img/restart-button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/restart-button.png
--------------------------------------------------------------------------------
/assets/img/sendscore-button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/sendscore-button.png
--------------------------------------------------------------------------------
/assets/img/tnt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/tnt.png
--------------------------------------------------------------------------------
/assets/img/touch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/touch.png
--------------------------------------------------------------------------------
/assets/img/touch_segment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/touch_segment.png
--------------------------------------------------------------------------------
/assets/img/tower1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/tower1.png
--------------------------------------------------------------------------------
/assets/img/trampoline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/trampoline.png
--------------------------------------------------------------------------------
/assets/img/underground-background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/img/underground-background.png
--------------------------------------------------------------------------------
/assets/js/phaser-touch-control.js:
--------------------------------------------------------------------------------
1 | /* global Phaser */
2 | /**
3 | * Phaser Touch Control Plugin
4 | * It adds a movement control for mobile and tablets devices
5 |
6 | The MIT License (MIT)
7 |
8 | Copyright (c) 2014 Eugenio Fage
9 | https://twitter.com/eugenioclrc
10 |
11 | Permission is hereby granted, free of charge, to any person obtaining a copy
12 | of this software and associated documentation files (the "Software"), to deal
13 | in the Software without restriction, including without limitation the rights
14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 | copies of the Software, and to permit persons to whom the Software is
16 | furnished to do so, subject to the following conditions:
17 |
18 | The above copyright notice and this permission notice shall be included in all
19 | copies or substantial portions of the Software.
20 |
21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 | SOFTWARE.
28 |
29 | Contact: https://github.com/eugenioclrc, @eugenioclrc
30 |
31 | */
32 |
33 | (function(window, Phaser) {
34 | 'use strict';
35 | /**
36 | * TouchControl Plugin for Phaser
37 | */
38 | Phaser.Plugin.TouchControl = function (game, parent) {
39 | /* Extend the plugin */
40 | Phaser.Plugin.call(this, game, parent);
41 | this.input = this.game.input;
42 |
43 | this.imageGroup = [];
44 |
45 | this.imageGroup.push(this.game.add.sprite(0, 0, 'compass'));
46 | this.imageGroup.push(this.game.add.sprite(0, 0, 'touch_segment'));
47 | this.imageGroup.push(this.game.add.sprite(0, 0, 'touch_segment'));
48 | this.imageGroup.push(this.game.add.sprite(0, 0, 'touch'));
49 |
50 | this.imageGroup.forEach(function (e) {
51 | e.anchor.set(0.5);
52 | e.visible=false;
53 | e.fixedToCamera=true;
54 | });
55 | };
56 |
57 | //Extends the Phaser.Plugin template, setting up values we need
58 | Phaser.Plugin.TouchControl.prototype = Object.create(Phaser.Plugin.prototype);
59 | Phaser.Plugin.TouchControl.prototype.constructor = Phaser.Plugin.TouchControl;
60 |
61 | Phaser.Plugin.TouchControl.prototype.settings = {
62 | // max distance from itial touch
63 | maxDistanceInPixels: 200,
64 | singleDirection: false
65 | };
66 |
67 |
68 | Phaser.Plugin.TouchControl.prototype.cursors = {
69 | up: false, down: false, left: false, right: false
70 | };
71 |
72 | Phaser.Plugin.TouchControl.prototype.speed = {
73 | x:0, y:0
74 | };
75 |
76 | Phaser.Plugin.TouchControl.prototype.inputEnable = function() {
77 | this.input.onDown.add(createCompass, this);
78 | this.input.onUp.add(removeCompass, this);
79 | };
80 |
81 | Phaser.Plugin.TouchControl.prototype.inputDisable = function() {
82 | this.input.onDown.remove(createCompass, this);
83 | this.input.onUp.remove(removeCompass, this);
84 | };
85 |
86 | var initialPoint;
87 | var createCompass = function(){
88 | this.imageGroup.forEach(function (e) {
89 | e.visible=true;
90 | e.bringToTop();
91 |
92 | e.cameraOffset.x=this.input.worldX;
93 | e.cameraOffset.y=this.input.worldY;
94 |
95 | }, this);
96 |
97 | this.preUpdate=setDirection.bind(this);
98 |
99 | initialPoint=this.input.activePointer.position.clone();
100 |
101 | };
102 | var removeCompass = function () {
103 | this.imageGroup.forEach(function(e){
104 | e.visible = false;
105 | });
106 |
107 | this.cursors.up = false;
108 | this.cursors.down = false;
109 | this.cursors.left = false;
110 | this.cursors.right = false;
111 |
112 | this.speed.x = 0;
113 | this.speed.y = 0;
114 |
115 | this.preUpdate=empty;
116 | };
117 |
118 | var empty = function(){
119 | };
120 |
121 | var setDirection = function() {
122 | var d=initialPoint.distance(this.input.activePointer.position);
123 | var maxDistanceInPixels = this.settings.maxDistanceInPixels;
124 |
125 | var deltaX=this.input.activePointer.position.x-initialPoint.x;
126 | var deltaY=this.input.activePointer.position.y-initialPoint.y;
127 |
128 | if(this.settings.singleDirection){
129 | if(Math.abs(deltaX) > Math.abs(deltaY)){
130 | deltaY = 0;
131 | this.input.activePointer.position.y=initialPoint.y;
132 | }else{
133 | deltaX = 0;
134 | this.input.activePointer.position.x=initialPoint.x;
135 | }
136 | }
137 | var angle = initialPoint.angle(this.input.activePointer.position);
138 |
139 |
140 | if (d>maxDistanceInPixels) {
141 | deltaX = (deltaX===0) ? 0 : Math.cos(angle) * maxDistanceInPixels;
142 | deltaY = (deltaY===0)? 0 : Math.sin(angle) * maxDistanceInPixels;
143 | }
144 |
145 | this.speed.x = parseInt((deltaX/maxDistanceInPixels) * 100 * -1, 10);
146 | this.speed.y = parseInt((deltaY/maxDistanceInPixels) * 100 * -1, 10);
147 |
148 |
149 | this.cursors.up = (deltaY < 0);
150 | this.cursors.down = (deltaY > 0);
151 | this.cursors.left = (deltaX < 0);
152 | this.cursors.right = (deltaX > 0);
153 |
154 | this.imageGroup.forEach(function(e,i){
155 | e.cameraOffset.x = initialPoint.x+(deltaX)*i/3;
156 | e.cameraOffset.y = initialPoint.y+(deltaY)*i/3;
157 | }, this);
158 |
159 | };
160 | Phaser.Plugin.TouchControl.prototype.preUpdate = empty;
161 |
162 |
163 | }(window, Phaser));
164 |
--------------------------------------------------------------------------------
/assets/sound/ding-end.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/sound/ding-end.mp3
--------------------------------------------------------------------------------
/assets/sound/ding.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/sound/ding.mp3
--------------------------------------------------------------------------------
/assets/sound/happy.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/sound/happy.mp3
--------------------------------------------------------------------------------
/assets/sound/jump.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/sound/jump.mp3
--------------------------------------------------------------------------------
/assets/sound/music.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/sound/music.mp3
--------------------------------------------------------------------------------
/assets/sound/rain.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/sound/rain.mp3
--------------------------------------------------------------------------------
/assets/sound/scary1.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/sound/scary1.mp3
--------------------------------------------------------------------------------
/assets/sound/splash-death.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/sound/splash-death.mp3
--------------------------------------------------------------------------------
/assets/sound/splash.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/sound/splash.mp3
--------------------------------------------------------------------------------
/assets/sound/switch.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/sound/switch.mp3
--------------------------------------------------------------------------------
/assets/sound/tnt.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/sound/tnt.mp3
--------------------------------------------------------------------------------
/assets/sound/trampoline_jump.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/assets/sound/trampoline_jump.mp3
--------------------------------------------------------------------------------
/css/main.css:
--------------------------------------------------------------------------------
1 | /*
2 | Main Content
3 | */
4 |
5 | /* temporary commented out for mobile feature testing
6 | canvas {
7 | position:absolute;
8 | left:50%;
9 | top:50%;
10 | margin:-188px 0 0 -320px;
11 | }
12 | */
13 |
14 | body{
15 | margin: 0;
16 | background-color: #000;
17 | }
18 |
19 | /*
20 | End of Main Content
21 | */
22 |
23 | /*
24 | Edit Mode
25 | */
26 |
27 | #editor-code {
28 | color: #bbb;
29 | width: 350px;
30 | height:438px;
31 | border: 3px solid #333;
32 | outline: none;
33 | display:none;
34 | padding: 5px;
35 | word-wrap: break-word;
36 | background-color: #222;
37 | }
38 |
39 | #editor-side {
40 | position: fixed;
41 | top:0;
42 | right:0;
43 | height:100%;
44 | width:200px;
45 | color: #ccc;
46 | display:none;
47 | background: #222;
48 | overflow-y: scroll;
49 | }
50 |
51 | #editor-side .button{
52 | cursor: pointer;
53 | padding: 5px;
54 | transition: .3s;
55 | text-align: center;
56 | font-weight: bold;
57 | background-color: #044;
58 | }
59 |
60 | #editor-side .button:hover{
61 | color: #fff;
62 | background-color: #066;
63 | }
64 |
65 | #editor-side .inputs{
66 | width: 100%;
67 | padding: 10px;
68 | box-sizing: border-box;
69 | }
70 |
71 | #editor-side .inputs label{
72 | font-weight: bold;
73 | }
74 |
75 | #editor-side .inputs input{
76 | width: 100%;
77 | margin-top: 4px;
78 | box-sizing: border-box;
79 | }
80 |
81 | #editor-side .inputs input:focus{
82 | outline: none;
83 | }
84 |
85 | #editor-side .header{
86 | font-size: 24px;
87 | font-weight: bold;
88 | padding: 0 6px;
89 | padding-bottom: 5px;
90 | border-bottom: 1px solid #444;
91 | }
92 |
93 | #editor-side ul{
94 | margin: 0;
95 | padding: 0;
96 | list-style: none;
97 | }
98 |
99 | #editor-side li{
100 | padding: 5px;
101 | transition: .3s;
102 | background-color: #444;
103 | border-bottom: 1px solid #333;
104 | }
105 |
106 | #editor-side li:hover{
107 | color: #fff;
108 | cursor: pointer;
109 | background-color: #151515;
110 | }
111 |
112 | /*
113 | End of Edit Mode
114 | */
--------------------------------------------------------------------------------
/gulpfile.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var browserify = require( "browserify" );
3 | var gulp = require( "gulp" );
4 | var source = require( "vinyl-source-stream" );
5 | var buffer = require( "vinyl-buffer" );
6 | var gutil = require( "gulp-util" );
7 | var uglify = require( "gulp-uglify" );
8 | var sourcemaps = require( "gulp-sourcemaps" );
9 | var browserSync = require( "browser-sync" ).create();
10 | gulp.task( "js", function() {
11 | // Set up the browserify instance on a task basis
12 | var b = browserify( {
13 | entries: "./index.js",
14 | debug: true
15 | // Defining transforms here will avoid crashing your stream
16 | } );
17 | return b.transform("babelify", {presets: ["es2015"]})
18 | .bundle()
19 | .pipe( source( "app.js" ) )
20 | // .pipe(buffer())
21 | // .pipe(sourcemaps.init({loadMaps: true}))
22 | // Add transformation tasks to the pipeline here.
23 | //.pipe(uglify())
24 | .on( "error", gutil.log )
25 | // .pipe(sourcemaps.write('./'))
26 | .pipe( gulp.dest( "./dist/js/" ) );
27 | } );
28 | // Create a task that ensures the `js` task is complete before
29 | // reloading browsers
30 | gulp.task( "js-watch", [ "js" ], browserSync.reload );
31 | // Use default task to launch Browsersync and watch JS files
32 | gulp.task( "serve", [ "js" ], function() {
33 | // Serve files from the root of this project
34 | browserSync.init( {
35 | server: {
36 | baseDir: "./"
37 | }
38 | } );
39 | // Add browserSync.reload to the tasks array to make
40 | // all browsers reload after tasks are complete.
41 | gulp.watch( [ "js/**/*.js", "index.js" ], [ "js-watch" ] );
42 | } );
43 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Evil Slime City - Slime rule the world! - v0.3
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
Save level
48 |
49 |
50 |
51 |
52 |
53 |
54 | - platfrom1
55 | - platform2
56 | - tower
57 | - redSlime
58 | - lava
59 | - lava2
60 | - arrow
61 | - faller
62 | - trampoline
63 | - tnt
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
--------------------------------------------------------------------------------
/index.js:
--------------------------------------------------------------------------------
1 | require ("./js/game.js");
2 | require ("./js/edit.js");
3 |
--------------------------------------------------------------------------------
/js/edit.js:
--------------------------------------------------------------------------------
1 | var _ = require( 'lodash' );
2 | import {GameState} from './gameState'
3 | let gState = new GameState().state;
4 |
5 | var a, b;
6 |
7 |
8 | function editable( items ) {
9 | items.forEachAlive( function( item ) {
10 | editItem( item );
11 | }, this );
12 | }
13 |
14 | function editItem( item ) {
15 | item.inputEnabled = true;
16 | item.input.enableDrag(false, true);
17 | item.events.onDragStop.add(onDragStart, item);
18 | function onDragStart() {
19 | this.levelRef.x = this.body.x;
20 | this.levelRef.y = this.body.y;
21 | window.refresh();
22 | }
23 | }
24 |
25 | window.refresh = function() {
26 | a = _.cloneDeep( window.level );
27 | document.querySelector( '#editor-code' ).value = JSON.stringify( a , null, 4 );
28 | }
29 |
30 | window.enterEditMode = function() {
31 | refresh();
32 | window.editMode = true;
33 | document.querySelector( "#editor-side" ).style.display = "block";
34 | document.querySelector( "#editor-code" ).style.display = "block";
35 |
36 | for ( var i in gState.envObjects ) {
37 | editable( gState.envObjects[ i ] );
38 | }
39 | }
40 |
41 | function addObj( x, y, type, assetName, immovable ) {
42 | var tmpObj = gState.envObjects[ type ].create( x , y, assetName );
43 | tmpObj.body.immovable = immovable;
44 | tmpObj.levelRef = window.level[ type ][ window.level[ type ].push( {x:x, y:y, type: assetName } ) - 1 ];
45 | editItem( tmpObj );
46 | refresh();
47 |
48 | }
49 |
50 |
51 |
52 | var elementMap = {
53 | platform1: {
54 | belongsTo: 'platforms',
55 | asset: 'platform',
56 | immovable: true
57 | },
58 | platform2: {
59 | belongsTo: 'platforms',
60 | asset: 'platform2',
61 | immovable: true
62 | },
63 | tower: {
64 | belongsTo: 'platforms',
65 | asset: 'tower1',
66 | immovable: true
67 | },
68 | slime: {
69 | belongsTo: 'redSlimes',
70 | asset: 'monster2',
71 | immovable: false
72 | },
73 | lava: {
74 | belongsTo: 'lava',
75 | asset: 'lava',
76 | immovable: true
77 | },
78 | lava2: {
79 | belongsTo: 'lava',
80 | asset: 'lava2',
81 | immovable: true
82 | },
83 | arrow: {
84 | belongsTo: 'arrows',
85 | asset: 'arrow',
86 | immovable: true
87 | },
88 | faller: {
89 | belongsTo: 'fallers',
90 | asset: 'faller',
91 | immovable: true
92 | },
93 | trampoline: {
94 | belongsTo: 'trampolines',
95 | asset: 'trampoline',
96 | immovable: true
97 | },
98 | tnt: {
99 | belongsTo: 'tnt',
100 | asset: 'tnt',
101 | immovable: true
102 | }
103 | }
104 |
105 |
106 | window.addElementClick = function( event ) {
107 | var canvas = document.querySelector( 'canvas' );
108 | var body = document.querySelector( 'body' );
109 | var type = event.target.dataset.element;
110 | body.style.cursor = 'crosshair';
111 | function addElementAfterClick(){
112 | body.style.cursor = '';
113 | addObj(
114 | game.input.activePointer.worldX,
115 | game.input.activePointer.worldY,
116 | elementMap[ type ].belongsTo,
117 | elementMap[ type ].asset,
118 | elementMap[ type ].immovable
119 | );
120 | canvas.removeEventListener( 'click', addElementAfterClick );
121 | }
122 | canvas.addEventListener( 'click', addElementAfterClick );
123 | }
124 |
125 |
126 | window.reload = function() { game.state.start( 'play' ); }
127 |
128 | var saveDom = document.querySelector( "#save" );
129 | var lavelName = document.querySelector( "#levelName" );
130 |
131 |
132 |
133 | saveDom.addEventListener( 'click', function() {
134 | var xhr = new XMLHttpRequest();
135 |
136 | // send the collected data as JSON
137 | var data = {
138 | path: levelName.value,
139 | content: window.level
140 | }
141 |
142 | data = JSON.stringify( data );
143 |
144 | xhr.open( 'POST', 'http://localhost:8888', true);
145 | xhr.send( data );
146 |
147 | xhr.onloadend = function ( msg ) {
148 | console.log( msg );
149 | };
150 | } );
151 |
--------------------------------------------------------------------------------
/js/game.js:
--------------------------------------------------------------------------------
1 | var game = new Phaser.Game(640, 376, Phaser.AUTO, 'gameDiv'),
2 | initState = require( './states/init' ),
3 | playState = require( './states/play' ),
4 | menuState = require( './states/menu' );
5 |
6 | game.global = {
7 | gameLevel : 0,
8 | music : null,
9 | music2 : null,
10 | rainSound : null,
11 | time : null,
12 | isHardMode : false,
13 | isCheckScroeMode : false,
14 | }
15 | //make the game a global object
16 | window.game = game;
17 | game.state.add('init', initState);
18 | game.state.add('menu', menuState);
19 | game.state.add('play', playState);
20 |
21 | game.state.start('init');
22 |
--------------------------------------------------------------------------------
/js/gameState.js:
--------------------------------------------------------------------------------
1 | let defaultState = {
2 | player: {},
3 | emitters: {
4 | juiceEmitters: [],
5 | rainEmitter: {}
6 | },
7 | envObjects: {
8 | tnt: {},
9 | lava: {},
10 | trampolines: {},
11 | platforms: {},
12 | riders: {},
13 | fallers: {},
14 | arrows: {},
15 | switchFallers: {},
16 | redSlimes: []
17 | },
18 | flags: {
19 | canBoostFlag : true,
20 | canTntExplode : true,
21 | isPlayerDead : false,
22 | hasPlayerWon : false
23 | },
24 | cursors: {},
25 | spaceKey: {},
26 | gamePad: {},
27 | }
28 | let instance = null;
29 |
30 | export class GameState {
31 | constructor() {
32 | if( !instance ) {
33 | instance = this;
34 | instance.state = defaultState;
35 | window.state = instance.state;
36 | }
37 | return instance;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/js/levels/index.js:
--------------------------------------------------------------------------------
1 | import {Level1} from './logic/level01'
2 | import {Level2} from './logic/level02'
3 | import {Level3} from './logic/level03'
4 | import {Level4} from './logic/level04'
5 | import {Level5} from './logic/level05'
6 | import {Level6} from './logic/level06'
7 | import {Level7} from './logic/level07'
8 | import {Level8} from './logic/level08'
9 | import {Level9} from './logic/level09'
10 | import {Level10} from './logic/level10'
11 | import {Level11} from './logic/level11'
12 | import {Level12} from './logic/level12'
13 | import {Level13} from './logic/level13'
14 | import {Level14} from './logic/level14'
15 | import {Level15} from './logic/level15'
16 | import {Level16} from './logic/level16'
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | export{ Level1, Level2, Level3, Level4, Level5, Level6, Level7, Level8, Level9, Level10, Level11, Level12, Level13, Level14, Level15, Level16 }
29 |
--------------------------------------------------------------------------------
/js/levels/logic/level01.js:
--------------------------------------------------------------------------------
1 | import {GameState} from '../../gameState'
2 | import {LevelPrototype} from './levelPrototype'
3 | let gState = new GameState().state;
4 | let _ = require( "lodash" );
5 |
6 | let lvl = require( "./../structures/level01.js" );
7 | export class Level1 extends LevelPrototype {
8 | constructor() {
9 | super();
10 | let protoLevel = _.cloneDeep( this.prototypeLevel );
11 | this.levelObj = _.merge( protoLevel, lvl );
12 | }
13 |
14 | getHardModeJumpLimit(){
15 | return 4;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/js/levels/logic/level02.js:
--------------------------------------------------------------------------------
1 | import {GameState} from '../../gameState'
2 | import {LevelPrototype} from './levelPrototype'
3 | let gState = new GameState().state;
4 | let _ = require( "lodash" );
5 |
6 | let lvl = require( "./../structures/level02.js" );
7 |
8 | export class Level2 extends LevelPrototype{
9 |
10 |
11 | constructor() {
12 | super();
13 | let protoLevel = _.cloneDeep( this.prototypeLevel );
14 | this.levelObj = _.merge( protoLevel, lvl );
15 | }
16 |
17 | getHardModeJumpLimit(){
18 | return 3;
19 | }
20 |
21 | addStartingText(){
22 | var levelLabel = game.add.text(110, 278, 'Kill 2 red evil slimes!',
23 | {font: '20px Courier', fill: '#fff'});
24 | setTimeout(function(){
25 | levelLabel.kill();
26 | }, 3000);
27 | }
28 |
29 | addEndingText(){
30 | game.add.text(gState.player.x - 200, 100, 'Nice!',
31 | {font: '40px Courier', fill: '#fff'});
32 | game.add.text(gState.player.x - 200, 136, 'Get ready for more...',
33 | {font: '20px Courier', fill: '#fff'});
34 | }
35 |
36 |
37 |
38 |
39 | handleRidersLogic(){
40 | this.rider1 = gState.envObjects.riders.children[0];
41 | if(this.rider1.x > 650){
42 | this.rider1.body.velocity.x = -100;
43 | }
44 | }
45 |
46 | checkForCoolKillText(){
47 | if( gState.envObjects.redSlimes.countLiving() == 1 ){
48 | var infoLabel = game.add.text(310, 278, 'One more!',
49 | {font: '20px Courier', fill: '#fff'});
50 | setTimeout(function(){
51 | infoLabel.kill();
52 | }, 3000);
53 | }
54 | }
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/js/levels/logic/level03.js:
--------------------------------------------------------------------------------
1 | import {GameState} from '../../gameState'
2 | import {LevelPrototype} from './levelPrototype'
3 | let g = new GameState().state;
4 | let _ = require( "lodash" );
5 |
6 | let lvl = require( "./../structures/level03.js" );
7 |
8 | export class Level3 extends LevelPrototype{
9 | constructor() {
10 | super();
11 | let protoLevel = _.cloneDeep( this.prototypeLevel );
12 | this.levelObj = _.merge( protoLevel, lvl );
13 | }
14 |
15 | getHardModeJumpLimit(){
16 | return 0;
17 | }
18 |
19 | addStartingText(){
20 | var levelLabel = game.add.text(0, 50, 'Time to blow some shit up!',
21 | {font: '20px Courier', fill: '#fff'});
22 | setTimeout(function(){
23 | levelLabel.kill();
24 | }, 3000);
25 | }
26 |
27 | addEndingText(){
28 | game.add.text(200, 100, 'Survived!',
29 | {font: '40px Courier', fill: '#fff'});
30 | game.add.text(200, 136, 'You lucky son of a slime!',
31 | {font: '20px Courier', fill: '#fff'});
32 | }
33 |
34 |
35 | handleRidersLogic(){
36 | }
37 |
38 | checkForCoolKillText(){
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/js/levels/logic/level04.js:
--------------------------------------------------------------------------------
1 | import {GameState} from '../../gameState'
2 | import {LevelPrototype} from './levelPrototype'
3 | let gState = new GameState().state;
4 | let _ = require( "lodash" );
5 |
6 | let lvl = require( "./../structures/level04.js" );
7 | export class Level4 extends LevelPrototype {
8 | constructor() {
9 | super();
10 | let protoLevel = _.cloneDeep( this.prototypeLevel );
11 | this.levelObj = _.merge( protoLevel, lvl );
12 | }
13 |
14 | getHardModeJumpLimit(){
15 | return 0;
16 | }
17 |
18 | addStartingText(){
19 | var levelLabel = game.add.text(290, 310, 'Time to be smart!',
20 | {font: '20px Courier', fill: '#fff'});
21 | setTimeout(function(){
22 | levelLabel.kill();
23 | }, 3000);
24 | }
25 |
26 | addEndingText(){
27 | game.add.text(360, 100, 'Woah!',
28 | {font: '40px Courier', fill: '#fff'});
29 | game.add.text(360, 136, 'Kinda smart... or just lucky?',
30 | {font: '20px Courier', fill: '#fff'});
31 | }
32 |
33 | }
--------------------------------------------------------------------------------
/js/levels/logic/level05.js:
--------------------------------------------------------------------------------
1 | import {GameState} from '../../gameState'
2 | import {LevelPrototype} from './levelPrototype'
3 | let gState = new GameState().state;
4 | let _ = require( "lodash" );
5 |
6 | let lvl = require( "./../structures/level05.js" );
7 | let levelFlag1 = true;
8 | let levelFlag2 = true;
9 | let spectrumFlag = true;
10 | let endingFlag = true;
11 |
12 |
13 |
14 | export class Level5 extends LevelPrototype {
15 | constructor() {
16 | super();
17 | let protoLevel = _.cloneDeep( this.prototypeLevel );
18 | this.levelObj = _.merge( protoLevel, lvl );
19 | this.resetFancyLevelStuff();
20 | }
21 |
22 | getHardModeJumpLimit(){
23 | return 5;
24 | }
25 |
26 | resetFancyLevelStuff(){
27 | levelFlag1 = true;
28 | levelFlag2 = true;
29 | spectrumFlag = true;
30 | endingFlag = true;
31 |
32 | }
33 |
34 | addStartingText(){
35 | }
36 |
37 | handleSpecialLevelEvents(){
38 | if(levelFlag1 && gState.player.x > 200 ){
39 | game.camera.shake(0.01, 1000, true);
40 |
41 | levelFlag1 = false;
42 |
43 |
44 | var levelLabel = game.add.text(100, 110, 'Huh?',
45 | {font: '50px Courier', fill: '#fff'});
46 | setTimeout(function(){
47 | levelLabel.kill();
48 | }, 3000);
49 | }
50 |
51 |
52 | if(levelFlag2 && gState.player.x > 700 ){
53 | levelFlag2 = false;
54 |
55 | var levelLabel = game.add.text(600, 110, 'be careful...',
56 | {font: '30px Courier', fill: '#fff'});
57 | setTimeout(function(){
58 | levelLabel.kill();
59 | }, 3000);
60 |
61 |
62 | }
63 |
64 | if(spectrumFlag && gState.player.x > 1200){
65 | spectrumFlag = false
66 |
67 | var levelLabel = game.add.text(900, 110, 'RUN BACK!',
68 | {font: '60px Courier', fill: '#fff'});
69 |
70 |
71 | setTimeout(function(){
72 | var levelLabel = game.add.text(850, 210, 'JUMP!',
73 | {font: '40px Courier', fill: '#fff'});
74 | }, 800);
75 |
76 |
77 | game.sound.play('scary1');
78 |
79 |
80 | setTimeout(function(){
81 | game.camera.shake(0.03, 4000, true);
82 |
83 |
84 | setTimeout(function(){
85 | gState.envObjects.switchFallers.forEachAlive(function(item) {
86 | item.body.immovable = false;
87 | }, this);
88 | }, 1000);
89 |
90 | }, 1000);
91 | }
92 |
93 | if(!spectrumFlag && gState.player.x < 150){
94 | if(endingFlag){
95 | endingFlag = false;
96 | var levelLabel = game.add.text(20, 110, 'We said be careful!',
97 | {font: '30px Courier', fill: '#fff'});
98 | gState.flags.hasPlayerWon = true;
99 |
100 | game.global.gameLevel++;
101 |
102 | setTimeout(function(){
103 | game.state.start('play');
104 | }, 3000);
105 | }
106 |
107 | }
108 |
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/js/levels/logic/level06.js:
--------------------------------------------------------------------------------
1 | import {GameState} from '../../gameState'
2 | import {LevelPrototype} from './levelPrototype'
3 | let gState = new GameState().state;
4 | let _ = require( "lodash" );
5 |
6 | let lvl = require( "./../structures/level06.js" );
7 | export class Level6 extends LevelPrototype {
8 | constructor() {
9 | super();
10 |
11 | this.playerStartingX = 20;
12 | this.playerStartingY = 10;
13 | let protoLevel = _.cloneDeep( this.prototypeLevel );
14 | this.levelObj = _.merge( protoLevel, lvl );
15 | }
16 |
17 | getHardModeJumpLimit(){
18 | return 4;
19 | }
20 |
21 | addStartingText(){
22 | var levelLabel = game.add.text(290, 310, 'Ready for more?',
23 | {font: '20px Courier', fill: '#fff'});
24 | setTimeout(function(){
25 | levelLabel.kill();
26 | }, 3000);
27 | }
28 |
29 |
30 | handleRidersLogic(){
31 | this.rider1 = gState.envObjects.riders.children[0];
32 | if(this.rider1.x > 650){
33 | this.rider1.body.velocity.x = -100;
34 | }
35 |
36 | if(this.rider1.x < 390){
37 | this.rider1.body.velocity.x = 100;
38 | }
39 |
40 | }
41 |
42 | addEndingText(){
43 | window.game.add.text(
44 | gState.player.x - 200, 100, 'Nice!',
45 | {font: '40px Courier', fill: '#fff'});
46 | window.game.add.text(gState.player.x - 200, 136, 'You learn quickly....',
47 | {font: '20px Courier', fill: '#fff'}
48 | );
49 | }
50 |
51 |
52 | }
--------------------------------------------------------------------------------
/js/levels/logic/level07.js:
--------------------------------------------------------------------------------
1 | import {GameState} from '../../gameState'
2 | import {LevelPrototype} from './levelPrototype'
3 | let gState = new GameState().state;
4 | let _ = require( "lodash" );
5 |
6 | let lvl = require( "./../structures/level07.js" );
7 |
8 | let levelSwitchFallerFlag = true;
9 | let levelMidTextFlag = true;
10 |
11 |
12 | export class Level7 extends LevelPrototype {
13 | constructor() {
14 | super();
15 | let protoLevel = _.cloneDeep( this.prototypeLevel );
16 | this.levelObj = _.merge( protoLevel, lvl );
17 | this.playerStartingX = 10;
18 | this.resetFancyLevelStuff();
19 | }
20 |
21 | getHardModeJumpLimit(){
22 | return 9;
23 | }
24 |
25 | resetFancyLevelStuff(){
26 | levelSwitchFallerFlag = true;
27 | levelMidTextFlag = true;
28 | }
29 |
30 |
31 | addStartingText(){
32 | var loadingLabel = window.game.add.text(150, 298, 'Timing is everything', {font: '20px Courier', fill: '#fff'});
33 | setTimeout(function(){
34 | loadingLabel.kill();
35 | }, 5000);
36 | }
37 |
38 |
39 | handleSpecialLevelEvents(){
40 |
41 | if(levelSwitchFallerFlag && gState.player.x > 1000){
42 | levelSwitchFallerFlag = false;
43 | gState.envObjects.switchFallers.forEachAlive(function(item) {
44 | item.body.immovable = false;
45 | }, this);
46 |
47 | game.sound.play('scary1');
48 | game.camera.shake(0.03, 4000, true);
49 | }
50 |
51 | if(levelMidTextFlag && gState.player.x > 800){
52 | levelMidTextFlag = false;
53 |
54 | var loadingLabel = window.game.add.text(800, 20, 'Watch out!', {font: '60px Courier', fill: '#fff'});
55 | setTimeout(function(){
56 | loadingLabel.kill();
57 | }, 3000);
58 | }
59 |
60 | }
61 |
62 | addEndingText(){
63 | game.add.text(gState.player.x - 400, 100, 'Another one down!',
64 | {font: '40px Courier', fill: '#fff'});
65 | game.add.text(gState.player.x - 400, 136, 'What a cruel slimy world...',
66 | {font: '20px Courier', fill: '#fff'});
67 | }
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/js/levels/logic/level08.js:
--------------------------------------------------------------------------------
1 | import {GameState} from '../../gameState'
2 | import {LevelPrototype} from './levelPrototype'
3 | let gState = new GameState().state;
4 | let _ = require( "lodash" );
5 |
6 | let levelLightsFlag = true;
7 | let undergroundSprite, undergroundSprite2, undergroundSlime;
8 |
9 | let lvl = require( "./../structures/level08.js" );
10 | export class Level8 extends LevelPrototype {
11 | constructor() {
12 | super();
13 | let protoLevel = _.cloneDeep( this.prototypeLevel );
14 | this.levelObj = _.merge( protoLevel, lvl );
15 |
16 | levelLightsFlag = true;
17 | }
18 |
19 | getHardModeJumpLimit(){
20 | return 1;
21 | }
22 |
23 | addStartingText(){
24 | var loadingLabel = window.game.add.text(150, 298, 'Don\'t be afraid of the dark', {font: '20px Courier', fill: '#fff'});
25 | setTimeout(function(){
26 | loadingLabel.kill();
27 | }, 5000);
28 | undergroundSprite = game.add.sprite(0,376,'underground-background');
29 | undergroundSprite.visible = false;
30 | undergroundSprite2 = game.add.sprite(640,376,'underground-background');
31 | undergroundSprite2.visible = false;
32 |
33 | undergroundSlime = game.add.sprite(300,280,'big-green');
34 | undergroundSlime.visible = false;
35 | }
36 |
37 | resetFancyLevelStuff(){
38 | levelLightsFlag = true;
39 | }
40 |
41 | addEndingText(){
42 | window.game.add.text(
43 | gState.player.x - 300, 100, 'Splash!',
44 | {font: '40px Courier', fill: '#fff'});
45 | window.game.add.text(gState.player.x - 300, 136, '...a really juicy splash!',
46 | {font: '20px Courier', fill: '#fff'}
47 | );
48 | }
49 |
50 | handleSpecialLevelEvents(){
51 | if(levelLightsFlag && gState.player.y > 100){
52 | gState.envObjects.arrows.forEach(function(item) {
53 | item.kill();
54 | } , this);
55 | }
56 | if(levelLightsFlag && gState.player.y > 550){
57 | levelLightsFlag = false;
58 | let txt1 = window.game.add.text(80, 400, 'Wait a sec...', {font: '40px Courier', fill: '#fff'});
59 | let txt2 = window.game.add.text(100, 480, 'let me put the lights on', {font: '18px Courier', fill: '#fff'});
60 |
61 | setTimeout(function(){
62 | txt1.kill();
63 | txt2.kill();
64 |
65 | undergroundSprite.visible = true;
66 | undergroundSprite2.visible = true;
67 | undergroundSlime.visible = true;
68 | game.sound.play('switch');
69 |
70 | setTimeout(function(){
71 | let txt3 = window.game.add.text(70, 480, 'Hello there little slime....', {font: '18px Courier', fill: '#fff'});
72 | setTimeout(function(){
73 |
74 |
75 | txt3.kill();
76 | window.game.add.text(130, 510, 'Use this ->', {font: '18px Courier', fill: '#fff'});
77 |
78 | gState.envObjects.arrows.forEach(function(item) {
79 | item.reset(254, 507);
80 | } , this);
81 | }, 3000);
82 | }, 1000);
83 | }, 3000);
84 |
85 |
86 | }
87 | }
88 |
89 | }
90 |
--------------------------------------------------------------------------------
/js/levels/logic/level09.js:
--------------------------------------------------------------------------------
1 | import {GameState} from '../../gameState'
2 | import {LevelPrototype} from './levelPrototype'
3 | let gState = new GameState().state;
4 | let _ = require( "lodash" );
5 |
6 | let lvl = require( "./../structures/level09.js" );
7 | export class Level9 extends LevelPrototype {
8 | constructor() {
9 | super();
10 | let protoLevel = _.cloneDeep( this.prototypeLevel );
11 | this.levelObj = _.merge( protoLevel, lvl );
12 | }
13 |
14 | addStartingText(){
15 | let levelLabel = game.add.text(90, 110, 'Be Quick or Be Dead!',
16 | {font: '20px Courier', fill: '#fff'});
17 | setTimeout(function(){
18 | levelLabel.kill();
19 | }, 3000);
20 | }
21 |
22 | handleRidersLogic(){
23 | this.rider1 = gState.envObjects.riders.children[0];
24 | if(this.rider1.x < 50){
25 | this.rider1.body.velocity.x = 0;
26 | }
27 | }
28 |
29 | getHardModeJumpLimit(){
30 | return 7;
31 | }
32 |
33 | addEndingText(){
34 | window.game.add.text(
35 | gState.player.x - 270, 70, 'You are quick!',
36 | {font: '40px Courier', fill: '#fff'});
37 | window.game.add.text(gState.player.x - 270, 106, '...for a fancy slime.',
38 | {font: '20px Courier', fill: '#fff'}
39 | );
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/js/levels/logic/level10.js:
--------------------------------------------------------------------------------
1 | import {GameState} from '../../gameState'
2 | import {LevelPrototype} from './levelPrototype'
3 | let gState = new GameState().state;
4 | let _ = require( "lodash" );
5 |
6 | let lvl = require( "./../structures/level10.js" );
7 | export class Level10 extends LevelPrototype {
8 | constructor() {
9 | super();
10 | let protoLevel = _.cloneDeep( this.prototypeLevel );
11 | this.levelObj = _.merge( protoLevel, lvl );
12 | }
13 |
14 | addStartingText(){
15 | let startingTxt = window.game.add.text(80, 278, 'The floor is lava!', {font: '20px Courier', fill: '#fff'});
16 |
17 |
18 | setTimeout(function(){
19 | startingTxt.kill();
20 | }, 5000);
21 |
22 |
23 | }
24 |
25 | checkForCoolKillText(){
26 | if( gState.envObjects.redSlimes.countLiving() == 1 ){
27 | var infoLabel = game.add.text(gState.player.x - 200, 278, 'Almost done!',
28 | {font: '20px Courier', fill: '#fff'});
29 | setTimeout(function(){
30 | infoLabel.kill();
31 | }, 3000);
32 | }
33 | }
34 |
35 | addEndingText(){
36 | game.add.text(gState.player.x - 300, 100, 'Another one',
37 | {font: '40px Courier', fill: '#fff'});
38 | game.add.text(gState.player.x - 200, 136, 'bites the lava!',
39 | {font: '20px Courier', fill: '#fff'});
40 | }
41 |
42 | getHardModeJumpLimit(){
43 | return 4;
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/js/levels/logic/level11.js:
--------------------------------------------------------------------------------
1 | import {GameState} from '../../gameState'
2 | import {LevelPrototype} from './levelPrototype'
3 | let gState = new GameState().state;
4 | let _ = require( "lodash" );
5 |
6 | let lvl = require( "./../structures/level11.js" );
7 | export class Level11 extends LevelPrototype {
8 | constructor() {
9 | super();
10 | let protoLevel = _.cloneDeep( this.prototypeLevel );
11 | this.levelObj = _.merge( protoLevel, lvl );
12 | }
13 |
14 | addStartingText(){
15 | let levelLabel = game.add.text(20, 110, 'The red evil slimes are sometimes useful...',
16 | {font: '20px Courier', fill: '#fff'});
17 | setTimeout(function(){
18 | levelLabel.kill();
19 | }, 3000);
20 | }
21 |
22 | addEndingText(){
23 | window.game.add.text(
24 | gState.player.x - 200, 100, 'Well done...',
25 | {font: '40px Courier', fill: '#fff'});
26 | window.game.add.text(gState.player.x - 200, 136, '...or always lucky?',
27 | {font: '20px Courier', fill: '#fff'}
28 | );
29 | }
30 |
31 | getHardModeJumpLimit(){
32 | return 4;
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/js/levels/logic/level12.js:
--------------------------------------------------------------------------------
1 | import {GameState} from '../../gameState'
2 | import {LevelPrototype} from './levelPrototype'
3 | let gState = new GameState().state;
4 | let _ = require( "lodash" );
5 |
6 | let lvl = require( "./../structures/level12.js" );
7 | let levelFlag1 = true;
8 |
9 | export class Level12 extends LevelPrototype {
10 | constructor() {
11 | super();
12 | let protoLevel = _.cloneDeep( this.prototypeLevel );
13 | this.levelObj = _.merge( protoLevel, lvl );
14 | levelFlag1 = true;
15 | }
16 |
17 | addStartingText(){
18 | let levelLabel = game.add.text(20, 210, 'First things first...',
19 | {font: '20px Courier', fill: '#fff'});
20 | setTimeout(function(){
21 | levelLabel.kill();
22 | }, 3000);
23 | }
24 |
25 | handleRidersLogic(){
26 | this.rider1 = gState.envObjects.riders.children[0];
27 | if(this.rider1.x > 180){
28 | this.rider1.body.velocity.x = -100;
29 | }
30 |
31 | this.rider2 = gState.envObjects.riders.children[1];
32 | if(this.rider2.x > 500){
33 | this.rider2.body.velocity.x = -100;
34 | }
35 | }
36 |
37 | checkForCoolKillText(){
38 | if( gState.envObjects.redSlimes.countLiving() == 1 ){
39 | var infoLabel = game.add.text(310, 278, 'Half way through!',
40 | {font: '20px Courier', fill: '#fff'});
41 | setTimeout(function(){
42 | infoLabel.kill();
43 | }, 3000);
44 | }
45 | }
46 |
47 | handleSpecialLevelEvents(){
48 | if(levelFlag1 && gState.player.x > 880){
49 | levelFlag1 = false;
50 | game.sound.play('scary1');
51 | game.camera.shake(0.03, 3000, true);
52 | gState.envObjects.switchFallers.forEachAlive(function(item) {
53 | item.body.immovable = false;
54 | }, this);
55 | }
56 | }
57 |
58 | addEndingText(){
59 | window.game.add.text(
60 | gState.player.x - 200, 100, 'Tasty!',
61 | {font: '40px Courier', fill: '#fff'});
62 | window.game.add.text(gState.player.x - 200, 146, '...getting hungry yet?',
63 | {font: '20px Courier', fill: '#fff'}
64 | );
65 | }
66 |
67 | getHardModeJumpLimit(){
68 | return 6;
69 | }
70 |
71 |
72 | }
73 |
--------------------------------------------------------------------------------
/js/levels/logic/level13.js:
--------------------------------------------------------------------------------
1 | import {GameState} from '../../gameState'
2 | import {LevelPrototype} from './levelPrototype'
3 | let gState = new GameState().state;
4 | let _ = require( "lodash" );
5 |
6 | let lvl = require( "./../structures/level13.js" );
7 | export class Level13 extends LevelPrototype {
8 | constructor() {
9 | super();
10 | let protoLevel = _.cloneDeep( this.prototypeLevel );
11 | this.levelObj = _.merge( protoLevel, lvl );
12 | }
13 |
14 | addStartingText(){
15 | let levelLabel = game.add.text(20, 210, 'Patience is the companion of wisdom...',
16 | {font: '20px Courier', fill: '#fff'});
17 | setTimeout(function(){
18 | levelLabel.kill();
19 | }, 3000);
20 | }
21 |
22 | handleRidersLogic(){
23 | this.rider1 = gState.envObjects.riders.children[0];
24 | if(this.rider1.x < 1000){
25 | this.rider1.body.velocity.x = 100;
26 | }
27 |
28 | }
29 |
30 |
31 | addEndingText(){
32 | window.game.add.text(
33 | gState.player.x - 160, 100, 'What a wise slime!',
34 | {font: '40px Courier', fill: '#fff'});
35 | window.game.add.text(gState.player.x - 160, 136, 'So wise! So slimy!',
36 | {font: '22px Courier', fill: '#fff'}
37 | );
38 | }
39 |
40 | getHardModeJumpLimit(){
41 | return 4;
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/js/levels/logic/level14.js:
--------------------------------------------------------------------------------
1 | import {GameState} from '../../gameState'
2 | import {LevelPrototype} from './levelPrototype'
3 | let gState = new GameState().state;
4 | let _ = require( "lodash" );
5 |
6 | let spectrumFlag = true;
7 |
8 |
9 | let lvl = require( "./../structures/level14.js" );
10 | export class Level14 extends LevelPrototype {
11 | constructor() {
12 | super();
13 | let protoLevel = _.cloneDeep( this.prototypeLevel );
14 | this.levelObj = _.merge( protoLevel, lvl );
15 | spectrumFlag = true;
16 | }
17 |
18 | addStartingText(){
19 | let levelLabel = game.add.text(20, 158, 'Run...',
20 | {font: '20px Courier', fill: '#fff'});
21 | setTimeout(function(){
22 | levelLabel.kill();
23 | }, 3000);
24 | }
25 |
26 | handleSpecialLevelEvents(){
27 | if(spectrumFlag && gState.player.x > 150){
28 | spectrumFlag = false;
29 | game.sound.play('scary1');
30 | game.camera.shake(0.03, 4000, true);
31 |
32 | gState.envObjects.switchFallers.forEachAlive(function(item) {
33 | item.body.immovable = false;
34 | }, this);
35 |
36 | let levelLabel = game.add.text(100, 110, 'RUN!',
37 | {font: '60px Courier', fill: '#fff'});
38 | }
39 | }
40 |
41 |
42 | addEndingText(){
43 | game.add.text(gState.player.x - 400, 100, 'Phew...',
44 | {font: '40px Courier', fill: '#fff'});
45 | game.add.text(gState.player.x - 400, 136, 'that was close',
46 | {font: '20px Courier', fill: '#fff'});
47 | }
48 |
49 |
50 | handleRidersLogic(){
51 | this.rider1 = gState.envObjects.riders.children[0];
52 | if(this.rider1.x < 1525){
53 | this.rider1.body.velocity.x = 100;
54 | }
55 |
56 | }
57 |
58 | getHardModeJumpLimit(){
59 | return 8;
60 | }
61 |
62 |
63 | }
64 |
65 |
--------------------------------------------------------------------------------
/js/levels/logic/level15.js:
--------------------------------------------------------------------------------
1 | import {GameState} from '../../gameState'
2 | import {LevelPrototype} from './levelPrototype'
3 | let gState = new GameState().state;
4 | let _ = require( "lodash" );
5 |
6 | let lvl = require( "./../structures/level15.js" );
7 | export class Level15 extends LevelPrototype {
8 | constructor() {
9 | super();
10 | let protoLevel = _.cloneDeep( this.prototypeLevel );
11 | this.levelObj = _.merge( protoLevel, lvl );
12 | }
13 |
14 | addStartingText(){
15 | let levelLabel = game.add.text(20, 40, 'Final level! Good luck!',
16 | {font: '20px Courier', fill: '#fff'});
17 | setTimeout(function(){
18 | levelLabel.kill();
19 | }, 3000);
20 | }
21 |
22 | handleRidersLogic(){
23 | this.rider1 = gState.envObjects.riders.children[0];
24 | if(this.rider1.x > 200){
25 | this.rider1.body.velocity.x = -100;
26 | }
27 |
28 | }
29 |
30 | addEndingText(){
31 | window.game.add.text(
32 | gState.player.x - 200, 100, 'Wohoo!',
33 | {font: '40px Courier', fill: '#fff'});
34 | window.game.add.text(gState.player.x - 200, 136, 'Slurm for everyone!',
35 | {font: '22px Courier', fill: '#fff'}
36 | );
37 | }
38 |
39 | getHardModeJumpLimit(){
40 | return 7;
41 | }
42 |
43 | }
--------------------------------------------------------------------------------
/js/levels/logic/level16.js:
--------------------------------------------------------------------------------
1 | import {GameState} from '../../gameState'
2 | import {LevelPrototype} from './levelPrototype'
3 | let gState = new GameState().state;
4 | let _ = require( "lodash" );
5 |
6 | let lvl = require( "./../structures/level16.js" );
7 | let txtInput = null;
8 | let finalScore = null;
9 | const BIG = 100000;
10 | const API_KEY = "x";
11 | const SECRET_KEY = "x";
12 | let errorTxt = null;
13 | let sendingScroeTxt = null;
14 | let evilSlimesTxt = null;
15 | let evilSlimesTxt2 = null;
16 |
17 | let sendScoreButton = null;
18 | let youAreOnPlaceTxt = null;
19 |
20 | const MOVE_LEFT = 50;
21 |
22 | let leaderboardTxt = "";
23 |
24 | export class Level16 extends LevelPrototype {
25 | constructor() {
26 | super();
27 | let protoLevel = _.cloneDeep( this.prototypeLevel );
28 | this.levelObj = _.merge( protoLevel, lvl );
29 | }
30 |
31 | addStartingText(){
32 | leaderboardTxt = "";
33 | finalScore = game.global.time;
34 | let minutes = Math.floor(finalScore / 60);
35 | let seconds = finalScore % 60;
36 |
37 | if(!game.global.isCheckScroeMode){
38 | if(game.global.isHardMode){
39 | window.game.add.text(80, 30, 'Your time (hard mode): ' + minutes + ' minutes, ' + seconds + ' seconds', {font: '20px Courier', fill: '#fff'});
40 | } else {
41 | window.game.add.text(80, 30, 'Your time (easy mode): ' + minutes + ' minutes, ' + seconds + ' seconds', {font: '20px Courier', fill: '#fff'});
42 | }
43 | } else {
44 | if(game.global.isHardMode){
45 | window.game.add.text(80, 30, 'Check score (hard mode)', {font: '20px Courier', fill: '#fff'});
46 | } else {
47 | window.game.add.text(80, 30, 'Check score (easy mode): ', {font: '20px Courier', fill: '#fff'});
48 | }
49 | }
50 |
51 | if(!game.global.isCheckScroeMode){
52 | game.global.music.stop();
53 | game.global.music2.volume = 0.3;
54 | game.global.music2.play();
55 |
56 | evilSlimesTxt = window.game.add.text(40, 220, 'You defeated the red evil slimes!', {font: '20px Courier', fill: '#fff'});
57 | evilSlimesTxt2 = window.game.add.text(40, 240, 'The city is free again!', {font: '20px Courier', fill: '#fff'});
58 | }
59 |
60 |
61 | }
62 |
63 | addOptionalEndingScreen(){
64 | if(!game.global.isCheckScroeMode){
65 | window.game.add.text(280, 86, 'Name: ', {font: '20px Courier', fill: '#fff'});
66 |
67 | game.add.plugin(PhaserInput.Plugin);
68 | txtInput = game.add.inputField(340, 80, {
69 | font: '18px Arial',
70 | fill: '#212121',
71 | fontWeight: 'bold',
72 | width: 250,
73 | padding: 8,
74 | borderWidth: 1,
75 | borderColor: '#000',
76 | borderRadius: 6,
77 | });
78 | }
79 |
80 | let restartButton = game.add.button(100, 80, 'restart-button', this.restartGame, this, 0, 0, 1);
81 | if(game.global.isCheckScroeMode){
82 | sendScoreButton = game.add.button(410, 130, 'loadscore-button', this.sendScore, this, 0, 0, 1);
83 | } else {
84 | sendScoreButton = game.add.button(410, 130, 'sendscore-button', this.sendScore, this, 0, 0, 1);
85 | }
86 |
87 | App42.initialize(API_KEY, SECRET_KEY);
88 | }
89 |
90 | sendScore(){
91 | if(errorTxt != null){
92 | errorTxt.kill();
93 | }
94 | if(sendScoreButton != null){
95 | sendScoreButton.kill();
96 | }
97 |
98 | let requestTxt = "";
99 | if(window.game.global.isCheckScroeMode){
100 | requestTxt = "Reading score...";
101 | } else {
102 | requestTxt = "Sending score...";
103 | }
104 | sendingScroeTxt = window.game.add.text(320, 160, requestTxt, {font: '22px Courier', fill: '#fff'});
105 |
106 |
107 | App42.initialize(API_KEY, SECRET_KEY);
108 |
109 |
110 | setTimeout(function(){
111 | let gameName = "";
112 | if(game.global.isHardMode){
113 | gameName = "Evil Slime City Hard";
114 | } else {
115 | gameName = "Evil Slime City";
116 | }
117 |
118 | let userName = "";
119 |
120 | let gameScore = BIG - finalScore;
121 | let result;
122 |
123 | if(game.global.isCheckScroeMode){
124 | userName = "Score check";
125 | gameScore = 100;
126 | finalScore = 100;
127 | } else {
128 | userName = txtInput.value;
129 | if(userName == ""){
130 | userName = "Slimy Guest";
131 | }
132 | }
133 |
134 | var scoreBoardService = new App42ScoreBoard();
135 |
136 | scoreBoardService.saveUserScore(gameName,userName,gameScore,{
137 | success: function(object){
138 | console.log("Success!");
139 | if(sendingScroeTxt != null){
140 | sendingScroeTxt.kill();
141 | }
142 |
143 | if(evilSlimesTxt != null){
144 | evilSlimesTxt.kill();
145 | }
146 |
147 | if(evilSlimesTxt2 != null){
148 | evilSlimesTxt2.kill();
149 | }
150 |
151 |
152 | this.loadTopScores();
153 | },
154 |
155 | loadTopScores: function(object){
156 | let userPlace = 0;
157 | scoreBoardService.getTopNRankers(gameName, 1000, {
158 | success: function(object)
159 | {
160 | let game = JSON.parse(object);
161 | result = game.app42.response.games.game;
162 | let scoreList = result.scores.score;
163 | if (scoreList instanceof Array) {
164 | for (let i = 0; i < scoreList.length; i++) {
165 |
166 | if(userName == scoreList[i].userName){
167 | userPlace = i + 1;
168 | }
169 |
170 | let t = BIG - scoreList[i].value;
171 | let m = Math.floor(t / 60);
172 | let s = t % 60;
173 | //console.log(scoreList[i].userName + " - " + m + "m, " + s + "s");
174 | if(i < 6){
175 | leaderboardTxt += ((i+1) + ". " + scoreList[i].userName + " - " + m + "m, " + s + "s \n");
176 | }
177 | }
178 | } else {
179 | let t = BIG - scoreList.value;
180 | let m = Math.floor(t / 60);
181 | let s = t % 60;
182 | //console.log(scoreList.userName + " - " + m + "m, " + s + "s");;
183 | }
184 |
185 | window.game.add.text(290 - MOVE_LEFT, 150, leaderboardTxt, {font: '17px Courier', fill: '#fff'});
186 |
187 | if(!window.game.global.isCheckScroeMode){
188 | youAreOnPlaceTxt = window.game.add.text(340, 120, 'Your place: ' + userPlace, {font: '17px Courier', fill: '#fff'});
189 | youAreOnPlaceTxt.fontWeight = 'bold';
190 | }
191 |
192 | let modeText = "";
193 | if(window.game.global.isHardMode){
194 | modeText = "(Hard Mode)";
195 | } else {
196 | modeText = "(Easy Mode)";
197 | }
198 |
199 | let top6Txt = window.game.add.text(140 - MOVE_LEFT, 180, ' THE\nTOP 6 -> \n', {font: '25px Courier', fill: '#fff'});
200 | top6Txt.fontWeight = 'bold';
201 | let top6ModeTxt = window.game.add.text(140 - MOVE_LEFT, 240, modeText, {font: '18px Courier', fill: '#fff'});
202 |
203 | },
204 | error: function(error) {
205 | }
206 | });
207 | },
208 |
209 | error: function(object){
210 | console.log("Error!");
211 | errorTxt = window.game.add.text(290, 120, 'Connection error... pls try again.', {font: '17px Courier', fill: '#ff0000'});
212 | errorTxt.fontWeight = 'bold';
213 |
214 | sendScoreButton.reset(410, 130);
215 |
216 | if(sendingScroeTxt != null){
217 | sendingScroeTxt.kill();
218 | }
219 |
220 | } });
221 | }, 200);
222 | }
223 |
224 |
225 | restartGame(){
226 | if(!game.global.isCheckScroeMode){
227 | game.global.music2.stop();
228 | }
229 |
230 | game.global.gameLevel = 0;
231 | game.state.start('menu');
232 | }
233 |
234 | getHardModeJumpLimit(){
235 | return 999999;
236 | }
237 |
238 | isScoreLvl(){
239 | return true;
240 | }
241 |
242 | }
243 |
--------------------------------------------------------------------------------
/js/levels/logic/levelPrototype.js:
--------------------------------------------------------------------------------
1 | import {GameState} from '../../gameState'
2 | let gState = new GameState().state;
3 | //set local pointers;
4 |
5 | let lvl = require( '../structures/levelStruct' );
6 | export class LevelPrototype{
7 | _create( type, props ) {
8 | gState.envObjects[ type ] = window.game.add.group();
9 | gState.envObjects[ type ].enableBody = true;
10 | for ( var i in props ) {
11 |
12 | var tmpObj = gState.envObjects[ type ].create( props[ i ].x, props[ i ].y, props[ i ].type );
13 | tmpObj.levelRef = props[ i ];
14 | props[ i ].id = Math.ceil( Date.now() * Math.random() );
15 | }
16 | }
17 |
18 | constructor( ) {
19 | this.prototypeLevel = lvl;
20 | this.playerStartingX = 40;
21 | this.playerStartingY = 10;
22 | }
23 |
24 | addStartingText(){
25 | var loadingLabel = window.game.add.text(80, 278, 'Kill the evil slime! -->', {font: '20px Courier', fill: '#fff'});
26 | setTimeout(function(){
27 | loadingLabel.kill();
28 | }, 5000);
29 | }
30 |
31 | addOptionalEndingScreen(){
32 | // default no ending screen
33 | }
34 |
35 | resetFancyLevelStuff(){
36 | // default do nothing
37 | }
38 |
39 | getHardModeJumpLimit(){
40 | return 10;
41 | }
42 |
43 | isScoreLvl(){
44 | return false;
45 | }
46 |
47 | createBackground(){
48 | window.game.world.setBounds(
49 | this.levelObj.world.bounds.x1,
50 | this.levelObj.world.bounds.y1,
51 | this.levelObj.world.bounds.x2,
52 | this.levelObj.world.bounds.y2
53 | );
54 | for (var i in this.levelObj.world.sprites ) {
55 | window.game.add.sprite(
56 | this.levelObj.world.sprites[ i ].x,
57 | this.levelObj.world.sprites[ i ].y,
58 | this.levelObj.world.sprites[ i ].type,
59 | )
60 | }
61 | }
62 |
63 | addPlatforms(){
64 | this._create( 'platforms', this.levelObj.platforms );
65 | }
66 |
67 | addArrows(){
68 | this._create( 'arrows' , this.levelObj.arrows );
69 | }
70 |
71 | addRedSlimes(){
72 | this._create( 'redSlimes' , this.levelObj.redSlimes );
73 | }
74 |
75 | addFallers(){
76 | this._create( 'fallers' , this.levelObj.fallers );
77 | }
78 |
79 | addSlowFallers(){
80 | this._create( 'slowFallers', this.levelObj.slowFallers)
81 | }
82 |
83 | addTrampolines(){
84 | this._create( 'trampolines', this.levelObj.trampolines );
85 | }
86 |
87 | addLava(){
88 | this._create( 'lava', this.levelObj.lava );
89 | }
90 |
91 | addSwitchFallers(){
92 | this._create( 'switchFallers', this.levelObj.switchFallers );
93 | }
94 |
95 | addEndingText(){
96 | window.game.add.text(
97 | gState.player.x - 200, 100, 'Great!',
98 | {font: '40px Courier', fill: '#fff'});
99 | window.game.add.text(gState.player.x - 200, 136, 'Time for the next one....',
100 | {font: '20px Courier', fill: '#fff'}
101 | );
102 | }
103 |
104 | addTnt(){
105 | this._create( 'tnt', this.levelObj.tnt );
106 | window.game.physics.arcade.enable( gState.envObjects.tnt );
107 | gState.envObjects.tnt.forEachAlive( function( item ){
108 | item.body.bounce.y = 0.2;
109 | item.body.gravity.y = 300;
110 | item.body.collideWorldBounds = true;
111 | item.animations.add('exploding', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]);
112 | item.animations.add('stand', [0]);
113 |
114 |
115 | }, this );
116 | }
117 |
118 | addRiders(){
119 | this._create( 'riders', this.levelObj.riders );
120 | }
121 |
122 | handleRidersLogic(){
123 | }
124 |
125 | handleSpecialLevelEvents(){
126 | }
127 |
128 | checkForCoolKillText(){
129 | }
130 |
131 |
132 | }
133 |
--------------------------------------------------------------------------------
/js/levels/structures/level01.js:
--------------------------------------------------------------------------------
1 | module.exports ={
2 | platforms: [
3 | { x:0, y: 300, type: 'platform' },
4 | { x:197, y: 300, type: 'platform2' },
5 | { x:506, y: 300, type: 'platform' },
6 | { x:646, y: 300, type: 'platform' },
7 | { x:646, y: 112, type: 'tower1' }
8 | ],
9 | redSlimes: [
10 | { x: 670,y: 10, type: 'monster2' }
11 | ],
12 | fallers: [
13 | { x: 340, y: 282, type: 'faller' }
14 | ],
15 | slowFallers: [],
16 | trampolines: [ { x: 600, y: 270, type: 'trampoline' } ],
17 | lava: [
18 | { x:141, y: 332, type: 'lava' },
19 | { x:254, y: 332, type: 'lava2' },
20 | { x:700, y: 332, type: 'lava2' }
21 | ],
22 | tnt: [],
23 | riders: [],
24 | switchFallers: []
25 | }
26 |
--------------------------------------------------------------------------------
/js/levels/structures/level02.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | world: {
3 | bounds: { x1: 0, y1:0, x2: 1705, y2: 376 },
4 | sprites: [
5 | { x: 0, y: 0, type: 'game-background'},
6 | { x: 640, y: 0, type: 'game-background'},
7 | { x: 1280, y: 0, type: 'game-background'}
8 | ]
9 | },
10 | platforms: [
11 | {x: 754, y: 172, type: 'tower1' },
12 | {x: 887, y: 300, type: 'platform' },
13 | {x: 1169, y: 300, type: 'platform' },
14 | {x: 1169, y: 272, type: 'tower1' },
15 | {x: 1310, y: 300, type: 'platform' },
16 | {x: 1451, y: 300, type: 'platform' },
17 | {x: 1410, y: 187, type: 'tower1' },
18 | {x: 185, y: 309, type: 'tower1' },
19 | {x: 400, y: 288, type: 'tower1' }
20 | ],
21 | redSlimes: [
22 | {x: 1470, y: 10, type: 'monster2' },
23 | {x: 390, y: 70, type: 'monster2' }
24 | ],
25 | slowFallers: [
26 | {x: 20, y: 282, type: 'faller' }
27 | ],
28 | trampolines: [
29 | {x: 50, y: 270, type: 'trampoline' },
30 | {x: 950, y: 270, type: 'trampoline' },
31 | {x: 453, y: 261, type: 'trampoline'}
32 | ],
33 | lava: [
34 | {x: 0, y: 332, type: 'lava2' },
35 | {x: 252, y: 332, type: 'lava2' },
36 | {x: 502, y: 332, type: 'lava2' },
37 | {x: 754, y: 332, type: 'lava2' },
38 | {x: 1000, y: 332, type: 'lava2' },
39 | {x: 1510, y: 352, type: 'lava2' }
40 | ],
41 | arrows: [ {x: 1230, y: 240, type: 'arrow' } ],
42 | riders: [ {x: 490, y: 200, type: 'raider' } ]
43 | }
44 |
--------------------------------------------------------------------------------
/js/levels/structures/level03.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | world: {
3 | bounds: { x1: 0, y1:0, x2: 640, y2: 376 },
4 | sprites: [
5 | { x: 0, y: 0, type: 'game-background'}
6 | ]
7 | },
8 | platforms: [
9 | {x: 0, y: 112, type: 'tower1' },
10 | {x: 1, y: 300, type: 'platform' },
11 | {x: 421, y: 289, type: 'faller' }
12 | ],
13 | redSlimes: [
14 | {x: 350, y: 10, type: 'monster2' },
15 | {x: 560, y: 10, type: 'monster2' }
16 | ],
17 | fallers: [
18 | ],
19 | slowFallers: [],
20 | trampolines: [ {x: 160, y:10, type: 'trampoline'} ],
21 | lava: [
22 | {x: 142, y: 332, type: 'lava' },
23 | {x: 198, y: 332, type: 'lava' },
24 | {x: 254, y: 332, type: 'lava2' },
25 | {x: 506, y: 332, type: 'lava2' }
26 | ],
27 | tnt: [ { x:360, y:150, type: 'tnt' } ],
28 | switchFallers: [
29 | {x: 136, y: 242, type: 'faller' },
30 | {x: 330, y: 112, type: 'faller' },
31 | {x: 208, y: 242, type: 'platform' },
32 | {x: 349, y: 289, type: 'faller' },
33 | {x: 493, y: 289, type: 'faller' },
34 | {x: 565, y: 289, type: 'faller' },
35 | {x: 530, y: 32, type: 'tower1' }
36 | ],
37 | riders: []
38 | }
39 |
--------------------------------------------------------------------------------
/js/levels/structures/level04.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | "world": {
3 | "bounds": {
4 | "x1": 0,
5 | "x2": 885,
6 | "y1": 0,
7 | "y2": 376
8 | },
9 | "sprites": [
10 | {
11 | "x": 0,
12 | "y": 0,
13 | "type": "game-background"
14 | },
15 | {
16 | "x": 640,
17 | "y": 0,
18 | "type": "game-background"
19 | }
20 | ]
21 | },
22 | "platforms": [
23 | {
24 | "x": -9,
25 | "y": 325,
26 | "type": "platform",
27 | "id": 1408244779348
28 | },
29 | {
30 | "x": 131,
31 | "y": 325,
32 | "type": "platform"
33 | },
34 | {
35 | "x": 525,
36 | "y": 278,
37 | "type": "tower1"
38 | },
39 | {
40 | "x": 658,
41 | "y": 312,
42 | "type": "platform"
43 | },
44 | {
45 | "x": 799,
46 | "y": 312,
47 | "type": "platform"
48 | }
49 | ],
50 | "redSlimes": [
51 | {x: 739, y: 256, type: 'monster2' }
52 | ],
53 | "fallers": [],
54 | "slowFallers": [],
55 | "trampolines": [],
56 | "lava": [
57 | {
58 | "x": 271,
59 | "y": 355,
60 | "type": "lava2"
61 | }
62 | ],
63 | "tnt": [],
64 | "switchFallers": [],
65 | "riders": [],
66 | "arrows": [
67 | {
68 | "x": 191,
69 | "y": 292,
70 | "type": "arrow"
71 | },
72 | {
73 | "x": 826,
74 | "y": 281,
75 | "type": "arrow"
76 | }
77 | ]
78 | }
--------------------------------------------------------------------------------
/js/levels/structures/level05.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | "world": {
3 | "bounds": {
4 | "x1": 0,
5 | "x2": 1485,
6 | "y1": 0,
7 | "y2": 376
8 | },
9 | "sprites": [
10 | {
11 | "x": 0,
12 | "y": 0,
13 | "type": "game-background"
14 | },
15 | {
16 | "x": 200,
17 | "y": -70,
18 | "type": "big-green"
19 | },
20 | {
21 | "x": 640,
22 | "y": 0,
23 | "type": "game-background"
24 | },
25 | {
26 | "x": 700,
27 | "y": -70,
28 | "type": "big-red"
29 | },
30 | {
31 | "x": 1280,
32 | "y": 0,
33 | "type": "game-background"
34 | },
35 | {
36 | "x": 1120,
37 | "y": -70,
38 | "type": "big-green"
39 | }
40 | ]
41 | },
42 | "platforms": [
43 | {
44 | "x": 0,
45 | "y": 300,
46 | "type": "platform",
47 | "id": 1235411664778
48 | },
49 | {
50 | "x": 141,
51 | "y": 300,
52 | "type": "platform",
53 | "id": 820596597205
54 | },
55 | ],
56 | "redSlimes": [],
57 | "fallers": [],
58 | "slowFallers": [],
59 | "trampolines": [],
60 | "lava": [
61 | {
62 | "x": 2,
63 | "y": 351,
64 | "type": "lava2"
65 | },
66 | {
67 | "x": 249,
68 | "y": 351,
69 | "type": "lava2"
70 | },
71 | {
72 | "x": 496,
73 | "y": 351,
74 | "type": "lava2"
75 | },
76 | {
77 | "x": 726,
78 | "y": 351,
79 | "type": "lava2"
80 | },
81 | {
82 | "x": 946,
83 | "y": 351,
84 | "type": "lava2"
85 | },
86 | {
87 | "x": 1106,
88 | "y": 351,
89 | "type": "lava2"
90 | },
91 | {
92 | "x": 1266,
93 | "y": 351,
94 | "type": "lava2"
95 | },
96 | ],
97 | "tnt": [],
98 | "switchFallers": [
99 | {
100 | "x": 281,
101 | "y": 300,
102 | "type": "platform",
103 | "id": 1425989278529
104 | },
105 | {
106 | "x": 422,
107 | "y": 300,
108 | "type": "platform",
109 | "id": 1309367633696
110 | },
111 | {
112 | "x": 563,
113 | "y": 300,
114 | "type": "platform",
115 | "id": 1399662534809
116 | },
117 | {
118 | "x": 704,
119 | "y": 300,
120 | "type": "platform",
121 | "id": 1291826865865
122 | },
123 | {
124 | "x": 845,
125 | "y": 300,
126 | "type": "platform"
127 | },
128 | {
129 | "x": 986,
130 | "y": 300,
131 | "type": "platform"
132 | },
133 | {
134 | "x": 1126,
135 | "y": 300,
136 | "type": "platform"
137 | },
138 | {
139 | "x": 1267,
140 | "y": 300,
141 | "type": "platform"
142 | },
143 | {
144 | "x": 1406,
145 | "y": 300,
146 | "type": "platform"
147 | }
148 | ],
149 | "riders": [],
150 | "arrows": [
151 |
152 | ]
153 | }
--------------------------------------------------------------------------------
/js/levels/structures/level06.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | "world": {
3 | "bounds": {
4 | "x1": 0,
5 | "x2": 1785,
6 | "y1": 0,
7 | "y2": 376
8 | },
9 | "sprites": [
10 | {
11 | "x": 0,
12 | "y": 0,
13 | "type": "game-background"
14 | },
15 | {
16 | "x": 640,
17 | "y": 0,
18 | "type": "game-background"
19 | },
20 | {
21 | "x": 1280,
22 | "y": 0,
23 | "type": "game-background"
24 | }
25 | ]
26 | },
27 | "platforms": [
28 | {
29 | "x": -9,
30 | "y": 325,
31 | "type": "platform",
32 | "id": 376397722070
33 | },
34 | {
35 | "x": 132,
36 | "y": 228,
37 | "type": "tower1"
38 | },
39 | {
40 | "x": 732,
41 | "y": 228,
42 | "type": "tower1"
43 | },
44 | {
45 | "x": 1286,
46 | "y": 256,
47 | "type": "platform2"
48 | },
49 | {
50 | "x": 1605,
51 | "y": 289,
52 | "type": "tower1"
53 | },
54 |
55 | {
56 | "x": 1456,
57 | "y": 256,
58 | "type": "platform2"
59 | },
60 | {
61 | "x": 1512,
62 | "y": 256,
63 | "type": "platform2"
64 | }
65 | ],
66 | "redSlimes": [
67 | {
68 | "x": 1295,
69 | "y": 84,
70 | "type": "monster2"
71 | },
72 | {
73 | "x": 1664,
74 | "y": 243,
75 | "type": "monster2"
76 | },
77 | {
78 | "x": 1500,
79 | "y": 47,
80 | "type": "monster2"
81 | }
82 | ],
83 | "fallers": [
84 | {
85 | "x": 310,
86 | "y": 231,
87 | "type": "faller"
88 | }
89 | ],
90 | "slowFallers": [],
91 | "trampolines": [
92 | {
93 | "x": 94,
94 | "y": 291,
95 | "type": "trampoline"
96 | }
97 | ],
98 | "lava": [
99 | {
100 | "x": 261,
101 | "y": 344,
102 | "type": "lava2"
103 | },
104 | {
105 | "x": 507,
106 | "y": 344,
107 | "type": "lava2"
108 | },
109 | {
110 | "x": 863,
111 | "y": 343,
112 | "type": "lava2"
113 | },
114 | {
115 | "x": 1108,
116 | "y": 343,
117 | "type": "lava2"
118 | },
119 | {
120 | "x": 1354,
121 | "y": 343,
122 | "type": "lava2"
123 | },
124 | {
125 | "x": 1739,
126 | "y": 342,
127 | "type": "lava"
128 | }
129 | ],
130 | "tnt": [
131 | {
132 | "x": 921,
133 | "y": 100,
134 | "type": "tnt"
135 | }
136 | ],
137 | "switchFallers": [
138 | {
139 | "x": 863,
140 | "y": 256,
141 | "type": "platform2",
142 | "id": 23179806283
143 | },
144 | {
145 | "x": 920,
146 | "y": 256,
147 | "type": "platform2",
148 | "id": 1060645558198
149 | },
150 | {
151 | "x": 976,
152 | "y": 256,
153 | "type": "platform2",
154 | "id": 1221493678658
155 | },
156 | {
157 | "x": 1033,
158 | "y": 256,
159 | "type": "platform2",
160 | "id": 203961076118
161 | },
162 | {
163 | "x": 1090,
164 | "y": 256,
165 | "type": "platform2",
166 | "id": 915226457059
167 | },
168 | {
169 | "x": 1145,
170 | "y": 256,
171 | "type": "platform"
172 | },
173 | {
174 | "x": 1272,
175 | "y": 127,
176 | "type": "faller"
177 | },
178 | {
179 | "x": 1342,
180 | "y": 256,
181 | "type": "platform2"
182 | },
183 | {
184 | "x": 1399,
185 | "y": 256,
186 | "type": "platform2"
187 | },
188 | {
189 | "x": 1439,
190 | "y": 69,
191 | "type": "tower1"
192 | }
193 |
194 | ],
195 | "riders": [
196 | {
197 | "x": 500,
198 | "y": 231,
199 | "type": "raider"
200 | }
201 | ],
202 | "arrows": []
203 | }
--------------------------------------------------------------------------------
/js/levels/structures/level07.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | "world": {
3 | "bounds": {
4 | "x1": 0,
5 | "x2": 2085,
6 | "y1": 0,
7 | "y2": 376
8 | },
9 | "sprites": [
10 | {
11 | "x": 0,
12 | "y": 0,
13 | "type": "game-background"
14 | },
15 | {
16 | "x": 640,
17 | "y": 0,
18 | "type": "game-background"
19 | },
20 | {
21 | "x": 1024,
22 | "y": 0,
23 | "type": "game-background"
24 | },
25 | {
26 | "x": 1664,
27 | "y": 0,
28 | "type": "game-background"
29 | },
30 | {
31 | "x": 1109,
32 | "y": -70,
33 | "type": "big-red"
34 | }
35 | ]
36 | },
37 | "platforms": [
38 | {
39 | "x": 10,
40 | "y": 188,
41 | "type": "tower1",
42 | "id": 209199860357
43 | },
44 | {
45 | "x": 1676,
46 | "y": 267,
47 | "type": "tower1",
48 | "id": 516408706630
49 | },
50 | {
51 | "x": 1900,
52 | "y": 298,
53 | "type": "tower1"
54 | }
55 | ],
56 | "redSlimes": [
57 | {
58 | "x": 1953,
59 | "y": 223.04166666666666,
60 | "type": "monster2",
61 | "id": 1263957183243
62 | }
63 | ],
64 | "fallers": [
65 | {
66 | "x": 240,
67 | "y": 246,
68 | "type": "faller",
69 | "id": 546624540103
70 | },
71 | {
72 | "x": 362,
73 | "y": 246,
74 | "type": "faller",
75 | "id": 1235056530331
76 | },
77 | {
78 | "x": 462,
79 | "y": 246,
80 | "type": "faller",
81 | "id": 481197537530
82 | },
83 | {
84 | "x": 562,
85 | "y": 246,
86 | "type": "faller",
87 | "id": 501783115091
88 | },
89 | {
90 | "x": 662,
91 | "y": 246,
92 | "type": "faller",
93 | "id": 825140467296
94 | }
95 | ],
96 | "slowFallers": [],
97 | "trampolines": [],
98 | "lava": [
99 | {
100 | "x": 143,
101 | "y": 329,
102 | "type": "lava2",
103 | "id": 848898472161
104 | },
105 | {
106 | "x": 639,
107 | "y": 329,
108 | "type": "lava2",
109 | "id": 653131176887
110 | },
111 | {
112 | "x": 393,
113 | "y": 329,
114 | "type": "lava2",
115 | "id": 1084265858976
116 | },
117 | {
118 | "x": 891,
119 | "y": 329,
120 | "type": "lava2",
121 | "id": 884432671270
122 | },
123 | {
124 | "x": 1136,
125 | "y": 329,
126 | "type": "lava2",
127 | "id": 840885852335
128 | },
129 | {
130 | "x": 1382,
131 | "y": 329,
132 | "type": "lava2",
133 | "id": 1177110395644
134 | },
135 | {
136 | "x": 1629,
137 | "y": 329,
138 | "type": "lava2",
139 | "id": 320137299605
140 | },
141 | {
142 | "x": 1873,
143 | "y": 329,
144 | "type": "lava2",
145 | "id": 918062019504
146 | }
147 | ],
148 | "tnt": [],
149 | "switchFallers": [
150 | {
151 | "x": 897,
152 | "y": 172,
153 | "type": "tower1",
154 | "id": 393178108881
155 | },
156 | {
157 | "x": 1030,
158 | "y": 284,
159 | "type": "platform",
160 | "id": 263807247532
161 | },
162 | {
163 | "x": 1320,
164 | "y": 284,
165 | "type": "platform",
166 | "id": 91035515434
167 | },
168 | {
169 | "x": 1167,
170 | "y": 284,
171 | "type": "platform2",
172 | "id": 1265374755007
173 | },
174 | {
175 | "x": 1219,
176 | "y": 284,
177 | "type": "platform2",
178 | "id": 663893970827
179 | },
180 | {
181 | "x": 1273,
182 | "y": 284,
183 | "type": "platform2",
184 | "id": 23614916251
185 | },
186 | {
187 | "x": 1461,
188 | "y": 284,
189 | "type": "platform2",
190 | "id": 1098662405779
191 | },
192 | {
193 | "x": 1518,
194 | "y": 284,
195 | "type": "platform2",
196 | "id": 558773850601
197 | },
198 | {
199 | "x": 1574,
200 | "y": 284,
201 | "type": "platform2",
202 | "id": 526928216579
203 | },
204 | {
205 | "x": 1622,
206 | "y": 284,
207 | "type": "platform2",
208 | "id": 1457111900272
209 | }
210 | ],
211 | "riders": [],
212 | "arrows": [
213 | {
214 | "x": 494,
215 | "y": 217,
216 | "type": "arrow",
217 | "id": 582459268374
218 | }
219 | ]
220 | }
--------------------------------------------------------------------------------
/js/levels/structures/level08.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | "world": {
3 | "bounds": {
4 | "x1": 0,
5 | "x2": 700,
6 | "y1": 0,
7 | "y2": 576
8 | },
9 | "sprites": [
10 | {
11 | "x": 0,
12 | "y": 0,
13 | "type": "game-background"
14 | },
15 | {
16 | "x": 640,
17 | "y": 0,
18 | "type": "game-background"
19 | }
20 | ]
21 | },
22 | "platforms": [
23 | {
24 | "x": 0,
25 | "y": 300,
26 | "type": "platform",
27 | "id": 601927357145
28 | },
29 | {
30 | "x": 0,
31 | "y": 575,
32 | "type": "platform",
33 | "id": 1338658451970
34 | },
35 | {
36 | "x": 141,
37 | "y": 575,
38 | "type": "platform",
39 | "id": 816323959442
40 | },
41 | {
42 | "x": 282,
43 | "y": 575,
44 | "type": "platform",
45 | "id": 56469586187
46 | },
47 | {
48 | "x": 423,
49 | "y": 575,
50 | "type": "platform",
51 | "id": 979515944637
52 | },
53 | {
54 | "x": 564,
55 | "y": 575,
56 | "type": "platform",
57 | "id": 183988337246
58 | },
59 | {
60 | "x": 705,
61 | "y": 575,
62 | "type": "platform",
63 | "id": 50676239578
64 | },
65 | {
66 | "x": 846,
67 | "y": 575,
68 | "type": "platform",
69 | "id": 1382320553622
70 | },
71 | {
72 | "x": 568,
73 | "y": 250,
74 | "type": "faller"
75 | }
76 | ],
77 | "redSlimes": [
78 | {
79 | "x": 590,
80 | "y": 229,
81 | "type": "monster2"
82 | }
83 | ],
84 | "fallers": [
85 |
86 | ],
87 | "slowFallers": [],
88 | "trampolines": [],
89 | "lava": [
90 | {
91 | "x": 499,
92 | "y": 275,
93 | "type": "lava2"
94 | }
95 | ],
96 | "tnt": [],
97 | "switchFallers": [],
98 | "riders": [],
99 | "arrows": [
100 | {
101 | "x": 254,
102 | "y": 507,
103 | "type": "arrow",
104 | "id": 582459268374
105 | }
106 | ]
107 | }
--------------------------------------------------------------------------------
/js/levels/structures/level09.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | "world": {
3 | "bounds": {
4 | "x1": 0,
5 | "x2": 1785,
6 | "y1": 0,
7 | "y2": 376
8 | },
9 | "sprites": [
10 | {
11 | "x": 0,
12 | "y": 0,
13 | "type": "game-background"
14 | },
15 | {
16 | "x": 640,
17 | "y": 0,
18 | "type": "game-background"
19 | },
20 | {
21 | "x": 1024,
22 | "y": 0,
23 | "type": "game-background"
24 | },
25 | {
26 | "x": 1648,
27 | "y": 0,
28 | "type": "game-background"
29 | }
30 | ]
31 | },
32 | "platforms": [
33 | {
34 | "x": 349,
35 | "y": 228,
36 | "type": "tower1",
37 | "id": 504934655792
38 | },
39 | {
40 | "x": 0,
41 | "y": 230,
42 | "type": "tower1",
43 | "id": 1388478993286
44 | },
45 | {
46 | "x": 1250,
47 | "y": 214,
48 | "type": "tower1"
49 | },
50 | {
51 | "x": 1502,
52 | "y": 143,
53 | "type": "faller"
54 | }
55 |
56 |
57 | ],
58 | "redSlimes": [
59 | {
60 | "x": 1550,
61 | "y": 14,
62 | "type": "monster2"
63 | }
64 | ],
65 | "fallers": [
66 | {
67 | "x": 212,
68 | "y": 224,
69 | "type": "faller",
70 | "id": 691966402436
71 | },
72 | {
73 | "x": 683,
74 | "y": 215,
75 | "type": "faller",
76 | "id": 11662451897
77 | },
78 | {
79 | "x": 805,
80 | "y": 215,
81 | "type": "faller",
82 | "id": 754061279506
83 | },
84 | {
85 | "x": 955,
86 | "y": 215,
87 | "type": "faller",
88 | "id": 530603943683
89 | },
90 | {
91 | "x": 1105,
92 | "y": 215,
93 | "type": "faller",
94 | "id": 595284808168
95 | }
96 | ],
97 | "slowFallers": [],
98 | "trampolines": [
99 | {
100 | "x": 456,
101 | "y": 213,
102 | "type": "trampoline",
103 | "id": 139063441184
104 | }
105 | ],
106 | "lava": [
107 | {
108 | "x": 105,
109 | "y": 348,
110 | "type": "lava2",
111 | "id": 773572155358
112 | },
113 | {
114 | "x": 476,
115 | "y": 345,
116 | "type": "lava2",
117 | "id": 176870635368
118 | },
119 | {
120 | "x": 726,
121 | "y": 344,
122 | "type": "lava2",
123 | "id": 802674778620
124 | },
125 | {
126 | "x": 926,
127 | "y": 344,
128 | "type": "lava2",
129 | "id": 802674778620
130 | },
131 | {
132 | "x": 1126,
133 | "y": 344,
134 | "type": "lava2",
135 | "id": 802674778620
136 | },
137 | {
138 | "x": 1376,
139 | "y": 345,
140 | "type": "lava2",
141 |
142 | },
143 | {
144 | "x": 1576,
145 | "y": 345,
146 | "type": "lava2",
147 | }
148 | ],
149 | "tnt": [],
150 | "switchFallers": [],
151 | "riders": [
152 | {
153 | "x": 806,
154 | "y": 201,
155 | "type": "raider",
156 | "id": 237522340012
157 | }
158 | ],
159 | "arrows": [
160 | {
161 | "x": 1184,
162 | "y": 151,
163 | "type": "arrow"
164 | }
165 | ]
166 | }
--------------------------------------------------------------------------------
/js/levels/structures/level10.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | "world": {
3 | "bounds": {
4 | "x1": 0,
5 | "x2": 1500,
6 | "y1": 0,
7 | "y2": 376
8 | },
9 | "sprites": [
10 | {
11 | "x": 0,
12 | "y": 0,
13 | "type": "game-background"
14 | },
15 | {
16 | "x": 640,
17 | "y": 0,
18 | "type": "game-background"
19 | },
20 | {
21 | "x": 1280,
22 | "y": 0,
23 | "type": "game-background"
24 | }
25 | ]
26 | },
27 | "platforms": [
28 | {
29 | "x": 1385,
30 | "y": 176,
31 | "type": "platform2",
32 | "id": 473611523139
33 | },
34 | {
35 | "x": 1329,
36 | "y": 176,
37 | "type": "platform2",
38 | "id": 514652253717
39 | },
40 | {
41 | "x": 1386,
42 | "y": 328,
43 | "type": "tower1",
44 | "id": 1122092224161
45 | },
46 | {
47 | "x": 1254,
48 | "y": 318,
49 | "type": "tower1",
50 | "id": 419433402842
51 | },
52 | {
53 | "x": 1127,
54 | "y": 265,
55 | "type": "tower1",
56 | "id": 1352082629749
57 | }
58 | ],
59 | "redSlimes": [
60 | {
61 | "x": 1382,
62 | "y": 134,
63 | "type": "monster2",
64 | "id": 1313390460194
65 | },
66 | {
67 | "x": 1323,
68 | "y": 291,
69 | "type": "monster2",
70 | "id": 944089560433
71 | }
72 | ],
73 | "fallers": [
74 | {
75 | "x": 30,
76 | "y": 107,
77 | "type": "faller",
78 | "id": 810953299617
79 | },
80 | {
81 | "x": 130,
82 | "y": 136,
83 | "type": "faller",
84 | "id": 1144213776183
85 | },
86 | {
87 | "x": 230,
88 | "y": 164,
89 | "type": "faller",
90 | "id": 681019071010
91 | },
92 | {
93 | "x": 330,
94 | "y": 197,
95 | "type": "faller",
96 | "id": 433047704950
97 | },
98 | {
99 | "x": 430,
100 | "y": 244,
101 | "type": "faller",
102 | "id": 1136118178588
103 | },
104 | {
105 | "x": 530,
106 | "y": 287,
107 | "type": "faller",
108 | "id": 454962043489
109 | },
110 | {
111 | "x": 630,
112 | "y": 308,
113 | "type": "faller",
114 | "id": 225493354669
115 | },
116 | {
117 | "x": 730,
118 | "y": 287,
119 | "type": "faller",
120 | "id": 25434769026
121 | }
122 | ],
123 | "slowFallers": [],
124 | "trampolines": [
125 | {
126 | "x": 851,
127 | "y": 243,
128 | "type": "trampoline",
129 | "id": 265554488279
130 | },
131 | {
132 | "x": 851,
133 | "y": 211,
134 | "type": "trampoline",
135 | "id": 253362356498
136 | },
137 | {
138 | "x": 851,
139 | "y": 161,
140 | "type": "trampoline",
141 | "id": 243883972553
142 | },
143 | {
144 | "x": 851,
145 | "y": 121,
146 | "type": "trampoline",
147 | "id": 1310294097186
148 | },
149 | {
150 | "x": 851,
151 | "y": 91,
152 | "type": "trampoline",
153 | "id": 1133517836626
154 | },
155 | {
156 | "x": 851,
157 | "y": 71,
158 | "type": "trampoline",
159 | "id": 705002830893
160 | },
161 | {
162 | "x": 851,
163 | "y": 31,
164 | "type": "trampoline",
165 | "id": 125168926106
166 | }
167 | ],
168 | "lava": [
169 | {
170 | "x": 0,
171 | "y": 345,
172 | "type": "lava2"
173 | },
174 | {
175 | "x": 250,
176 | "y": 345,
177 | "type": "lava2"
178 | },
179 | {
180 | "x": 500,
181 | "y": 345,
182 | "type": "lava2"
183 | },
184 | {
185 | "x": 750,
186 | "y": 345,
187 | "type": "lava2"
188 | },
189 | {
190 | "x": 1000,
191 | "y": 345,
192 | "type": "lava2"
193 | }
194 | ],
195 | "tnt": [],
196 | "switchFallers": [],
197 | "riders": [],
198 | "arrows": [
199 | {
200 | "x": 1470,
201 | "y": 296,
202 | "type": "arrow",
203 | "id": 495983088899
204 | }
205 | ]
206 | }
--------------------------------------------------------------------------------
/js/levels/structures/level11.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | "world": {
3 | "bounds": {
4 | "x1": 0,
5 | "x2": 885,
6 | "y1": 0,
7 | "y2": 376
8 | },
9 | "sprites": [
10 | {
11 | "x": 0,
12 | "y": 0,
13 | "type": "game-background"
14 | },
15 | {
16 | "x": 640,
17 | "y": 0,
18 | "type": "game-background"
19 | }
20 | ]
21 | },
22 | "platforms": [
23 | {
24 | "x": 690,
25 | "y": 191,
26 | "type": "tower1",
27 | "id": 317767747930
28 | }
29 | ],
30 | "redSlimes": [
31 | {
32 | "x": 233,
33 | "y": 276.4222222222222,
34 | "type": "monster2",
35 | "id": 17342011327
36 | },
37 | {
38 | "x": 756,
39 | "y": 164,
40 | "type": "monster2",
41 | "id": 824798391200
42 | }
43 | ],
44 | "fallers": [],
45 | "slowFallers": [],
46 | "trampolines": [
47 | {
48 | "x": 477,
49 | "y": 227,
50 | "type": "trampoline",
51 | "id": 763668340740
52 | }
53 | ],
54 | "lava": [
55 | {
56 | "x": 1,
57 | "y": 348,
58 | "type": "lava2",
59 | "id": 1466044747671
60 | },
61 | {
62 | "x": 253,
63 | "y": 348,
64 | "type": "lava2",
65 | "id": 823460170396
66 | },
67 | {
68 | "x": 505,
69 | "y": 348,
70 | "type": "lava2",
71 | "id": 1186247555376
72 | },
73 | {
74 | "x": 705,
75 | "y": 348,
76 | "type": "lava2",
77 | "id": 732653437234
78 | }
79 | ],
80 | "tnt": [
81 | {
82 | "x": 71,
83 | "y": 251,
84 | "type": "tnt",
85 | "id": 361128106918
86 | }
87 | ],
88 | "switchFallers": [
89 | {
90 | "x": 0,
91 | "y": 300,
92 | "type": "platform",
93 | "id": 936217715008
94 | },
95 | {
96 | "x": 140,
97 | "y": 300,
98 | "type": "platform",
99 | "id": 1058672546741
100 | },
101 | {
102 | "x": 281,
103 | "y": 300,
104 | "type": "platform",
105 | "id": 1028133489654
106 | },
107 | {
108 | "x": 403,
109 | "y": 244,
110 | "type": "tower1",
111 | "id": 737891217523
112 | }
113 | ],
114 | "riders": [],
115 | "arrows": []
116 | }
--------------------------------------------------------------------------------
/js/levels/structures/level12.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | "world": {
3 | "bounds": {
4 | "x1": 0,
5 | "x2": 1278,
6 | "y1": 0,
7 | "y2": 376
8 | },
9 | "sprites": [
10 | {
11 | "x": 0,
12 | "y": 0,
13 | "type": "game-background"
14 | },
15 | {
16 | "x": 640,
17 | "y": 0,
18 | "type": "game-background"
19 | },
20 | {
21 | "x": 490,
22 | "y": -70,
23 | "type": "big-red"
24 | }
25 | ]
26 | },
27 | "platforms": [
28 |
29 | {
30 | "x": 1148,
31 | "y": 111,
32 | "type": "faller"
33 | }
34 | ],
35 | "redSlimes": [
36 | {
37 | "x": 360,
38 | "y": 100,
39 | "type": "monster2",
40 | "id": 202400311828
41 | },
42 | {
43 | "x": 1172,
44 | "y": 79,
45 | "type": "monster2"
46 | }
47 | ],
48 | "fallers": [],
49 | "slowFallers": [
50 | {
51 | "x": 379,
52 | "y": 320,
53 | "type": "faller",
54 | "id": 1157755160076
55 | }
56 | ],
57 | "trampolines": [
58 | {
59 | "x": 401,
60 | "y": 247,
61 | "type": "trampoline",
62 | "id": 1306818571338
63 | },
64 | {
65 | "x": 928,
66 | "y": 204,
67 | "type": "trampoline"
68 | }
69 | ],
70 | "lava": [
71 | {
72 | "x": 0,
73 | "y": 342,
74 | "type": "lava2",
75 | "id": 186195855101
76 | },
77 | {
78 | "x": 252,
79 | "y": 342,
80 | "type": "lava2",
81 | "id": 323519273520
82 | },
83 | {
84 | "x": 504,
85 | "y": 342,
86 | "type": "lava2",
87 | "id": 323519273520
88 | },
89 | {
90 | "x": 756,
91 | "y": 342,
92 | "type": "lava2",
93 | "id": 323519273520
94 | },
95 | {
96 | "x": 850,
97 | "y": 342,
98 | "type": "lava2",
99 | "id": 323519273520
100 | },
101 | {
102 | "x": 1026,
103 | "y": 342,
104 | "type": "lava2"
105 | }
106 | ],
107 | "tnt": [],
108 | "switchFallers": [
109 | {
110 | "x": 509,
111 | "y": 289,
112 | "type": "tower1",
113 | "id": 110906774026
114 | },
115 | {
116 | "x": 641,
117 | "y": 269,
118 | "type": "tower1",
119 | "id": 279403564131
120 | },
121 | {
122 | "x": 778,
123 | "y": 249,
124 | "type": "tower1",
125 | "id": 1264054172610
126 | },
127 | {
128 | "x": 909,
129 | "y": 230,
130 | "type": "tower1"
131 | }
132 | ],
133 | "riders": [
134 | {
135 | "x": 80,
136 | "y": 300,
137 | "type": "raider",
138 | "id": 168321116176
139 | },
140 | {
141 | "x": 380,
142 | "y": 140,
143 | "type": "raider",
144 | "id": 1090790259240
145 | }
146 | ],
147 | "arrows": []
148 | }
--------------------------------------------------------------------------------
/js/levels/structures/level13.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | "world": {
3 | "bounds": {
4 | "x1": 0,
5 | "x2": 1585,
6 | "y1": 0,
7 | "y2": 376
8 | },
9 | "sprites": [
10 | {
11 | "x": 0,
12 | "y": 0,
13 | "type": "game-background"
14 | },
15 | {
16 | "x": 640,
17 | "y": 0,
18 | "type": "game-background"
19 | },
20 | {
21 | "x": 1280,
22 | "y": 0,
23 | "type": "game-background"
24 | }
25 | ]
26 | },
27 | "platforms": [
28 | {
29 | "x": 156,
30 | "y": 281,
31 | "type": "tower1",
32 | "id": 311606636160
33 | }
34 |
35 | ],
36 | "redSlimes": [
37 | {
38 | "x": 1012,
39 | "y": 78,
40 | "type": "monster2",
41 | "id": 1037917020607
42 | }
43 | ],
44 | "fallers": [
45 | {
46 | "x": 2,
47 | "y": 265,
48 | "type": "tower1",
49 | "id": 741709772793
50 | },
51 | {
52 | "x": 316,
53 | "y": 267,
54 | "type": "tower1",
55 | "id": 956371365770
56 | },
57 | {
58 | "x": 468,
59 | "y": 249,
60 | "type": "tower1",
61 | "id": 1273585436899
62 | },
63 | {
64 | "x": 611,
65 | "y": 237,
66 | "type": "tower1",
67 | "id": 1480036013807
68 | },
69 | {
70 | "x": 763,
71 | "y": 247,
72 | "type": "tower1",
73 | "id": 453426506394
74 | },
75 | {
76 | "x": 919,
77 | "y": 260,
78 | "type": "tower1",
79 | "id": 1449964423708
80 | }
81 | ],
82 | "slowFallers": [],
83 | "trampolines": [],
84 | "lava": [
85 | {
86 | "x": 0,
87 | "y": 345,
88 | "type": "lava2"
89 | },
90 | {
91 | "x": 252,
92 | "y": 345,
93 | "type": "lava2"
94 | },
95 | {
96 | "x": 504,
97 | "y": 345,
98 | "type": "lava2"
99 | },
100 | {
101 | "x": 756,
102 | "y": 345,
103 | "type": "lava2"
104 | },
105 | {
106 | "x": 1008,
107 | "y": 345,
108 | "type": "lava2"
109 | },
110 | {
111 | "x": 1260,
112 | "y": 345,
113 | "type": "lava2"
114 | },
115 | {
116 | "x": 1512,
117 | "y": 345,
118 | "type": "lava2"
119 | }
120 | ],
121 | "tnt": [],
122 | "switchFallers": [],
123 | "riders": [
124 | {
125 | "x": 957,
126 | "y": 111,
127 | "type": "raider",
128 | "id": 72011193556
129 | }
130 | ],
131 | "arrows": [
132 | {
133 | "x": 580,
134 | "y": 211,
135 | "type": "arrow",
136 | "id": 790224261728
137 | }
138 | ]
139 | }
--------------------------------------------------------------------------------
/js/levels/structures/level14.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | "world": {
3 | "bounds": {
4 | "x1": 0,
5 | "x2": 1955,
6 | "y1": 0,
7 | "y2": 376
8 | },
9 | "sprites": [
10 | {
11 | "x": 0,
12 | "y": 0,
13 | "type": "game-background"
14 | },
15 | {
16 | "x": 640,
17 | "y": 0,
18 | "type": "game-background"
19 | },
20 | {
21 | "x": 1280,
22 | "y": 0,
23 | "type": "game-background"
24 | },
25 | {
26 | "x": 1920,
27 | "y": 0,
28 | "type": "game-background"
29 | },
30 | {
31 | "x": 30,
32 | "y": -70,
33 | "type": "big-green"
34 | },
35 | {
36 | "x": 420,
37 | "y": -70,
38 | "type": "big-red"
39 | },
40 | {
41 | "x": 840,
42 | "y": -70,
43 | "type": "big-green"
44 | }
45 | ]
46 | },
47 | "platforms": [
48 |
49 | ],
50 | "redSlimes": [
51 | {
52 | "x": 314,
53 | "y": 273,
54 | "type": "monster2",
55 | "id": 195441831207
56 | },
57 | {
58 | "x": 528,
59 | "y": 274,
60 | "type": "monster2",
61 | "id": 884383967084
62 | },
63 | {
64 | "x": 1908,
65 | "y": 117,
66 | "type": "monster2"
67 | }
68 | ],
69 | "fallers": [
70 |
71 | ],
72 | "slowFallers": [],
73 | "trampolines": [],
74 | "lava": [
75 | {
76 | "x": 0,
77 | "y": 342,
78 | "type": "lava2",
79 | "id": 186195855101
80 | },
81 | {
82 | "x": 252,
83 | "y": 342,
84 | "type": "lava2",
85 | "id": 323519273520
86 | },
87 | {
88 | "x": 504,
89 | "y": 342,
90 | "type": "lava2",
91 | "id": 323519273520
92 | },
93 | {
94 | "x": 756,
95 | "y": 342,
96 | "type": "lava2",
97 | "id": 323519273520
98 | },
99 | {
100 | "x": 850,
101 | "y": 342,
102 | "type": "lava2",
103 | "id": 323519273520
104 | },
105 | {
106 | "x": 1026,
107 | "y": 342,
108 | "type": "lava2"
109 | },
110 | {
111 | "x": 1196,
112 | "y": 342,
113 | "type": "lava2"
114 | },
115 |
116 | {
117 | "x": 1356,
118 | "y": 342,
119 | "type": "lava2"
120 | },
121 | {
122 | "x": 1500,
123 | "y": 342,
124 | "type": "lava2"
125 | },
126 | {
127 | "x": 1650,
128 | "y": 342,
129 | "type": "lava2"
130 | },
131 | {
132 | "x": 1800,
133 | "y": 342,
134 | "type": "lava2"
135 | }
136 | ],
137 | "tnt": [],
138 | "switchFallers": [
139 | {
140 | "x": 0,
141 | "y": 300,
142 | "type": "platform",
143 | "id": 432571238655
144 | },
145 | {
146 | "x": 141,
147 | "y": 300,
148 | "type": "platform2",
149 | "id": 954957581917
150 | },
151 | {
152 | "x": 196,
153 | "y": 300,
154 | "type": "platform2",
155 | "id": 986786819999
156 | },
157 | {
158 | "x": 253,
159 | "y": 300,
160 | "type": "platform2",
161 | "id": 777225567831
162 | },
163 | {
164 | "x": 309,
165 | "y": 300,
166 | "type": "platform2",
167 | "id": 284689203539
168 | },
169 | {
170 | "x": 365,
171 | "y": 300,
172 | "type": "platform2",
173 | "id": 361118140010
174 | },
175 | {
176 | "x": 422,
177 | "y": 300,
178 | "type": "platform2",
179 | "id": 1402193498274
180 | },
181 | {
182 | "x": 478,
183 | "y": 300,
184 | "type": "platform2",
185 | "id": 771977793295
186 | },
187 | {
188 | "x": 535,
189 | "y": 300,
190 | "type": "platform2",
191 | "id": 990477602718
192 | },
193 | {
194 | "x": 592,
195 | "y": 301,
196 | "type": "platform2",
197 | "id": 146464932458
198 | },
199 | {
200 | "x": 648,
201 | "y": 301,
202 | "type": "platform2",
203 | "id": 15127547710
204 | },
205 | {
206 | "x": 705,
207 | "y": 301,
208 | "type": "platform2",
209 | "id": 1150738518065
210 | },
211 | {
212 | "x": 755,
213 | "y": 301,
214 | "type": "platform2",
215 | "id": 990719344156
216 | },
217 | {
218 | "x": 805,
219 | "y": 301,
220 | "type": "platform2",
221 | "id": 448082475199
222 | },
223 | {
224 | "x": 855,
225 | "y": 301,
226 | "type": "platform2",
227 | "id": 930164503827
228 | },
229 | {
230 | "x": 905,
231 | "y": 301,
232 | "type": "platform2",
233 | "id": 47263509540
234 | },
235 | {
236 | "x": 955,
237 | "y": 301,
238 | "type": "platform2",
239 | "id": 1004375785558
240 | },
241 | {
242 | "x": 1005,
243 | "y": 301,
244 | "type": "platform2",
245 | "id": 806186775579
246 | },
247 | {
248 | "x": 1055,
249 | "y": 301,
250 | "type": "platform2",
251 | "id": 620534846092
252 | },
253 | {
254 | "x": 1105,
255 | "y": 301,
256 | "type": "platform2",
257 | "id": 255815879601
258 | },
259 | {
260 | "x": 1155,
261 | "y": 301,
262 | "type": "platform2",
263 | "id": 1028365468559
264 | },
265 | {
266 | "x": 1205,
267 | "y": 301,
268 | "type": "platform2",
269 | "id": 894154462177
270 | },
271 | {
272 | "x": 1261,
273 | "y": 278,
274 | "type": "tower1"
275 | }
276 | ],
277 | "riders": [
278 | {
279 | "x": 1969,
280 | "y": 149,
281 | "type": "raider"
282 | }
283 | ],
284 | "arrows": [
285 | {
286 | "x": 1043,
287 | "y": 250,
288 | "type": "arrow"
289 | }
290 | ]
291 | }
--------------------------------------------------------------------------------
/js/levels/structures/level15.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | "world": {
3 | "bounds": {
4 | "x1": 0,
5 | "x2": 1585,
6 | "y1": 0,
7 | "y2": 376
8 | },
9 | "sprites": [
10 | {
11 | "x": 0,
12 | "y": 0,
13 | "type": "game-background"
14 | },
15 | {
16 | "x": 640,
17 | "y": 0,
18 | "type": "game-background"
19 | },
20 | {
21 | "x": 1280,
22 | "y": 0,
23 | "type": "game-background"
24 | }
25 | ]
26 | },
27 | "platforms": [
28 | {
29 | "x": 1269,
30 | "y": 294,
31 | "type": "tower1",
32 | "id": 188448142620
33 | }
34 | ],
35 | "redSlimes": [
36 | {
37 | "x": 545.9999999999998,
38 | "y": 91.9166666666667,
39 | "type": "monster2",
40 | "id": 1479435898556
41 | },
42 | {
43 | "x": 235,
44 | "y": 99,
45 | "type": "monster2",
46 | "id": 619548598128
47 | },
48 | {
49 | "x": 1321,
50 | "y": 158,
51 | "type": "monster2",
52 | "id": 316626011617
53 | }
54 | ],
55 | "fallers": [],
56 | "slowFallers": [],
57 | "trampolines": [
58 | {
59 | "x": 17,
60 | "y": 268,
61 | "type": "trampoline",
62 | "id": 628738362658
63 | }
64 | ],
65 | "lava": [
66 | {
67 | "x": 0,
68 | "y": 345,
69 | "type": "lava2",
70 | "id": 1202125889499
71 | },
72 | {
73 | "x": 252,
74 | "y": 345,
75 | "type": "lava2",
76 | "id": 1124857896808
77 | },
78 | {
79 | "x": 504,
80 | "y": 345,
81 | "type": "lava2",
82 | "id": 1390952160424
83 | },
84 | {
85 | "x": 756,
86 | "y": 345,
87 | "type": "lava2",
88 | "id": 452520944088
89 | },
90 | {
91 | "x": 1008,
92 | "y": 345,
93 | "type": "lava2",
94 | "id": 660898746346
95 | },
96 | {
97 | "x": 1260,
98 | "y": 345,
99 | "type": "lava2",
100 | "id": 463820421263
101 | },
102 | {
103 | "x": 1512,
104 | "y": 345,
105 | "type": "lava2",
106 | "id": 62315665385
107 | }
108 | ],
109 | "tnt": [
110 | {
111 | "x": 68,
112 | "y": 183,
113 | "type": "tnt",
114 | "id": 620781246783
115 | }
116 | ],
117 | "switchFallers": [
118 | {
119 | "x": 617,
120 | "y": 311,
121 | "type": "tower1",
122 | "id": 228665250228
123 | },
124 | {
125 | "x": 768,
126 | "y": 300,
127 | "type": "tower1",
128 | "id": 382920924406
129 | },
130 | {
131 | "x": 921,
132 | "y": 286,
133 | "type": "tower1",
134 | "id": 1333102937272
135 | },
136 | {
137 | "x": 1074,
138 | "y": 289,
139 | "type": "tower1",
140 | "id": 1278322894253
141 | },
142 | {
143 | "x": 0,
144 | "y": 300,
145 | "type": "platform",
146 | "id": 1469273596762
147 | },
148 | {
149 | "x": 420,
150 | "y": 302,
151 | "type": "platform2",
152 | "id": 1032354187256
153 | },
154 | {
155 | "x": 141,
156 | "y": 301,
157 | "type": "platform",
158 | "id": 137084002517
159 | },
160 | {
161 | "x": 280,
162 | "y": 301,
163 | "type": "platform",
164 | "id": 800197817274
165 | },
166 | {
167 | "x": 475,
168 | "y": 139,
169 | "type": "tower1",
170 | "id": 901213112685
171 | },
172 | {
173 | "x": 60,
174 | "y": 243,
175 | "type": "faller",
176 | "id": 814932893983
177 | },
178 | {
179 | "x": 474,
180 | "y": 303,
181 | "type": "platform",
182 | "id": 1286924851174
183 | }
184 | ],
185 | "riders": [
186 | {
187 | "x": 233,
188 | "y": 126,
189 | "type": "raider",
190 | "id": 612830438764
191 | }
192 | ],
193 | "arrows": [
194 | ]
195 | }
--------------------------------------------------------------------------------
/js/levels/structures/level16.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | world: {
3 | bounds: { x1: 0, y1:0, x2: 640, y2: 376 },
4 | sprites: [
5 | { x: 0, y: 0, type: 'game-background'}
6 | ]
7 | },
8 | platforms: [
9 | {
10 | "x": 0,
11 | "y": 300,
12 | "type": "platform",
13 | "id": 601927357145
14 | },
15 | {
16 | "x": 140,
17 | "y": 300,
18 | "type": "platform",
19 | "id": 1338658451970
20 | },
21 | {
22 | "x": 280,
23 | "y": 300,
24 | "type": "platform",
25 | "id": 816323959442
26 | },
27 | {
28 | "x": 420,
29 | "y": 300,
30 | "type": "platform",
31 | "id": 56469586187
32 | },
33 | {
34 | "x": 540,
35 | "y": 300,
36 | "type": "platform",
37 | "id": 56469586187
38 | }
39 | ],
40 | redSlimes: [
41 | ],
42 | fallers: [
43 | ],
44 | slowFallers: [],
45 | trampolines: [],
46 | lava: [
47 | ],
48 | tnt: [ ],
49 | switchFallers: [
50 | ],
51 | riders: []
52 | }
53 |
--------------------------------------------------------------------------------
/js/levels/structures/levelStruct.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | world: {
3 | bounds: {
4 | x1: 0, x2: 885,
5 | y1: 0, y2: 376
6 | },
7 | sprites: [
8 | { x: 0, y:0, type: 'game-background'},
9 | { x: 640, y:0, type: 'game-background'}
10 | ]
11 | },
12 | platforms: [],
13 | redSlimes: [],
14 | fallers: [],
15 | slowFallers: [],
16 | trampolines: [],
17 | lava: [],
18 | tnt: [],
19 | switchFallers: [],
20 | riders: [],
21 | arrows: []
22 | };
23 |
--------------------------------------------------------------------------------
/js/states/init.js:
--------------------------------------------------------------------------------
1 | var initState = {
2 |
3 | preload: function(){
4 |
5 | var loadingLabel = game.add.text(20, 150, 'loading game data...',
6 | {font: '40px Courier', fill: '#fff'});
7 |
8 | game.load.audio('music', 'assets/sound/music.mp3'); // http://opengameart.org/content/rise-of-spirit
9 | game.load.audio('happy', 'assets/sound/happy.mp3'); // https://opengameart.org/content/in-russian-style
10 | game.load.audio('jump', 'assets/sound/jump.mp3');
11 | game.load.audio('trampoline_jump', 'assets/sound/trampoline_jump.mp3'); // http://freesound.org/people/arteffect/sounds/349854/
12 |
13 |
14 | game.load.audio('splash-death', 'assets/sound/splash-death.mp3'); // http://freesound.org/people/Setuniman/sounds/135774/
15 | game.load.audio('splash', 'assets/sound/splash.mp3'); // http://freesound.org/people/Setuniman/sounds/135774/
16 | game.load.audio('rain', 'assets/sound/rain.mp3'); // http://freesound.org/people/jmbphilmes/sounds/200272/
17 | game.load.audio('ding', 'assets/sound/ding.mp3'); // http://freesound.org/people/gloriaeffect/sounds/108428/
18 | game.load.audio('ding-end', 'assets/sound/ding-end.mp3'); // http://freesound.org/people/gloriaeffect/sounds/108428/
19 | game.load.audio('tnt', 'assets/sound/tnt.mp3'); // http://freesound.org/people/ryansnook/sounds/110111/
20 | // http://freesound.org/people/theneedle.tv/sounds/316682/
21 | game.load.audio('scary1', 'assets/sound/scary1.mp3'); // https://www.freesound.org/people/tyops/sounds/234226/
22 | game.load.audio('switch', 'assets/sound/switch.mp3'); // https://www.freesound.org/people/VKProduktion/sounds/217493/
23 |
24 |
25 |
26 | game.load.image('menu-background', 'assets/img/menu-background.png'); // http://opengameart.org/content/industrial-parallax-background
27 | game.load.image('game-background', 'assets/img/game-background.png'); // http://opengameart.org/content/industrial-parallax-background
28 | game.load.image('underground-background', 'assets/img/underground-background.png');
29 | game.load.spritesheet('mute-button', 'assets/img/mute-button.png', 90, 90);
30 | game.load.spritesheet('checkscore-button', 'assets/img/checkscore-button.png', 120, 90);
31 | game.load.spritesheet('restart-button', 'assets/img/restart-button.png', 90, 90);
32 | game.load.spritesheet('hardmode-button', 'assets/img/hardmode-button.png', 250, 145);
33 | game.load.spritesheet('sendscore-button', 'assets/img/sendscore-button.png', 90, 90);
34 | game.load.spritesheet('loadscore-button', 'assets/img/loadscore-button.png', 90, 90);
35 | game.load.image('big-green', 'assets/img/big-green.png');
36 | game.load.image('big-red', 'assets/img/big-red.png');
37 | game.load.image('platform', 'assets/img/platform.png');
38 | game.load.image('platform2', 'assets/img/platform2.png');
39 | game.load.image('tower1', 'assets/img/tower1.png');
40 | game.load.image('faller', 'assets/img/faller.png');
41 | game.load.image('raider', 'assets/img/raider.png');
42 | game.load.image('trampoline', 'assets/img/trampoline.png');
43 | game.load.spritesheet('arrow', 'assets/img/arrow.png', 22, 25);
44 | game.load.spritesheet('tnt', 'assets/img/tnt.png', 50, 50); // https://openclipart.org/detail/165734/dynamite
45 | game.load.image('mobile_direction', 'assets/img/mobile_direction.png');
46 | game.load.image('mobile_jump', 'assets/img/mobile_jump.png');
47 | game.load.spritesheet('lava', 'assets/img/lava.png', 56, 32);
48 | game.load.spritesheet('lava2', 'assets/img/lava2.png', 252, 32);
49 |
50 | game.load.image('particle', 'assets/img/particle.png');
51 | game.load.image('particle2', 'assets/img/particle2.png');
52 | game.load.image('red-particle', 'assets/img/particle-red.png');
53 | game.load.image('rain', 'assets/img/rain.png');
54 |
55 | game.load.spritesheet('monster1', 'assets/img/monster1.png', 30, 23); // http://opengameart.org/content/scifi-creature-tileset-mini-32x32-scifi-creature-icons
56 | game.load.spritesheet('monster2', 'assets/img/monster2.png', 30, 23); // http://opengameart.org/content/scifi-creature-tileset-mini-32x32-scifi-creature-icons
57 |
58 | game.load.image('compass', 'assets/img/compass_rose.png');
59 | game.load.image('touch_segment', 'assets/img/touch_segment.png');
60 | game.load.image('touch', 'assets/img/touch.png');
61 |
62 | },
63 |
64 | init: function () {
65 | game.physics.startSystem(Phaser.Physics.ARCADE);
66 | game.global.music = game.add.audio('music',1,true);
67 | game.global.music2 = game.add.audio('happy',1,true);
68 | game.global.rainSound = game.add.audio('rain',1,true);
69 |
70 | // playing around with scaling on mobile
71 | //if (!game.device.desktop){
72 | game.scale.scaleMode = Phaser.ScaleManager.USER_SCALE;
73 | game.scale.pageAlignHorizontally = true;
74 | game.scale.pageAlignVertically = true;
75 | //}
76 |
77 | },
78 |
79 |
80 | create: function() {
81 | this.init();
82 | game.state.start('menu');
83 | }
84 |
85 | };
86 | module.exports = initState;
87 |
--------------------------------------------------------------------------------
/js/states/menu.js:
--------------------------------------------------------------------------------
1 | var monster1, monster2;
2 | let muteButton, hardModeButton, checkScoreButton;
3 |
4 | var menuState = {
5 |
6 | create: function() {
7 | game.add.sprite(0, 0, 'menu-background');
8 |
9 | if (game.device.desktop){
10 | // desktop
11 | let startLabel = game.add.text(90, game.world.height-60, 'Press Space to start',{font: '25px Arial', fill: '#ffffff'});
12 | } else {
13 | // mobile
14 | let mobileStartButton = game.add.button(0, 0, 'menu-background', this.startGame, this, 2, 1, 0);
15 | let startLabel = game.add.text(90, game.world.height-60, 'Tap screen to start', {font: '25px Arial', fill: '#ffffff'});
16 | }
17 |
18 | game.global.music.play();
19 | game.global.music.volume = 1.0
20 |
21 | monster1 = game.add.sprite(50, game.world.height-60, 'monster1');
22 | monster1.animations.add('stand', [0, 1, 2], 5, true);
23 |
24 | monster2 = game.add.sprite(320, game.world.height-60, 'monster1');
25 | monster2.animations.add('stand', [0, 1, 2], 5, true);
26 |
27 |
28 | let spaceKey = game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR);
29 | spaceKey.onDown.addOnce(this.startGame, this);
30 |
31 | muteButton = game.add.button(480, 60, 'mute-button', this.muteSound, this, 0, 0, 1);
32 | hardModeButton = game.add.button(400, 160, 'hardmode-button', this.hardModeSwitch, this, 0, 0, 1);
33 | checkScoreButton = game.add.button(480, 300, 'checkscore-button', this.startScoreScreen, this, 0, 0, 1);
34 |
35 | game.global.time = 0;
36 | game.global.isCheckScroeMode = false;
37 | game.global.isHardMode = false;
38 | },
39 |
40 | update: function() {
41 | monster1.animations.play('stand');
42 | monster2.animations.play('stand');
43 | },
44 |
45 | startScoreScreen: function(){
46 | game.global.gameLevel = 15; // last game level
47 | game.global.isCheckScroeMode = true;
48 | this.startGame();
49 | },
50 |
51 | startGame: function(){
52 | game.sound.play('splash');
53 | game.global.music.volume = 0.3;
54 |
55 | game.state.start('play');
56 | },
57 |
58 | hardModeSwitch: function(){
59 | game.sound.play('splash');
60 | if(!game.global.isHardMode){
61 | game.global.isHardMode = true;
62 | hardModeButton.setFrames(1, 1, 0);
63 | } else {
64 | game.global.isHardMode = false;
65 | hardModeButton.setFrames(0, 0, 1);
66 | }
67 | },
68 |
69 | muteSound: function(){
70 | if(game.sound.mute){
71 | muteButton.setFrames(0, 0, 1);
72 | } else {
73 | muteButton.setFrames(1, 1, 0);
74 | }
75 | game.sound.mute = !game.sound.mute;
76 | },
77 |
78 | };
79 | module.exports = menuState;
80 |
--------------------------------------------------------------------------------
/js/states/play.js:
--------------------------------------------------------------------------------
1 | import {Level1, Level2, Level3, Level4, Level5, Level6, Level7, Level8, Level9, Level10, Level11, Level12, Level13, Level14, Level15, Level16} from '../levels'
2 | import {ArrowBooster} from '../utils/booster'
3 | import {CollisionsHandler} from '../utils/collisions'
4 | import {HardModeHandler} from '../utils/hardmode'
5 | import {RainEmitter, JuiceEmitters} from '../utils/emitters'
6 | import {TntHandler} from '../utils/tnt'
7 | import {GameState} from '../gameState'
8 | var level,
9 | collisionsHandler,
10 | arrowBooster,
11 | tntHandler,
12 | hardModeHandler;
13 |
14 |
15 | let gState = new GameState().state;
16 | let hardModeJumpCounter, timeCounterLabel, lvlNumberLabel;
17 |
18 | var playState = {
19 |
20 | resetState: function(){
21 | gState.flags.canBoostFlag = true;
22 | gState.flags.canTntExplode = true;
23 | gState.flags.isPlayerDead = false;
24 | gState.flags.hasPlayerWon = false;
25 | },
26 |
27 | chooseLevel: function(){
28 | const levels = [new Level1(), new Level2(), new Level3(), new Level4(), new Level5(), new Level6(), new Level7(),
29 | new Level8(), new Level9(), new Level10(), new Level11(), new Level12(), new Level13(), new Level14(), new Level15(), new Level16()];
30 | return levels[game.global.gameLevel];
31 | },
32 |
33 | create: function() {
34 | level = this.chooseLevel();
35 | window.level = level.levelObj;
36 | this.resetState();
37 |
38 | collisionsHandler = new CollisionsHandler();
39 | gState.emitters.juiceEmitters = new JuiceEmitters();
40 | arrowBooster = new ArrowBooster();
41 | tntHandler = new TntHandler();
42 | hardModeHandler = new HardModeHandler(game.global.isHardMode); // get this "true" from setting in menu
43 | hardModeHandler.setJumpLimit(level.getHardModeJumpLimit());
44 |
45 | level.createBackground(game);
46 | level.addStartingText(game);
47 | level.addOptionalEndingScreen(game);
48 |
49 |
50 | this.initTnt();
51 | this.initPlayer();
52 | this.initRedSlimes();
53 | this.initLava();
54 | this.initTrampolines();
55 | this.initSlowFallers();
56 | this.initPlatforms();
57 | this.initRiders();
58 | this.initFallers();
59 | this.initArrows();
60 | this.initSwitchFallers();
61 | this.initRain();
62 | this.initMobileControls();
63 |
64 | game.input.gamepad.start();
65 | gState.gamePad = game.input.gamepad.pad1;
66 | gState.cursors = game.input.keyboard.createCursorKeys();
67 | gState.spaceKey = game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR);
68 |
69 | game.camera.follow( gState.player);
70 |
71 | // init dummy timer
72 | game.time.events.loop(Phaser.Timer.SECOND, this.timerTick, this);
73 |
74 | if(game.global.isHardMode && !level.isScoreLvl()){
75 | hardModeJumpCounter = game.add.text(10, 10, 'Jumps left: ' + hardModeHandler.getJumpLimit(), {font: '20px Courier', fill: '#fff'});
76 | hardModeJumpCounter.fixedToCamera = true;
77 | }
78 |
79 | if(!level.isScoreLvl()){
80 | timeCounterLabel = game.add.text(570, 10, game.global.time, {font: '20px Courier', fill: '#fff'});
81 | timeCounterLabel.fixedToCamera = true;
82 |
83 | lvlNumberLabel = game.add.text(240, 10, "Level: " + (game.global.gameLevel + 1) + " / 15", {font: '20px Courier', fill: '#fff'});
84 | lvlNumberLabel.fixedToCamera = true;
85 | }
86 |
87 | let rKey = game.input.keyboard.addKey(Phaser.Keyboard.R);
88 | rKey.onDown.addOnce(this.restartGame, this);
89 |
90 | },
91 |
92 | restartGame: function(){
93 | game.global.gameLevel = 0;
94 | game.state.start('menu');
95 | },
96 |
97 | timerTick: function() {
98 | game.global.time++;
99 | },
100 |
101 | update: function() {
102 |
103 | if(hardModeHandler.getJumpLimit() < 0 && !gState.flags.isPlayerDead){
104 | this.killPlayer();
105 | }
106 |
107 | // collisios
108 | collisionsHandler.update();
109 |
110 | // animations
111 | gState.player.animations.play('stand');
112 | gState.envObjects.lava.forEachAlive(function(item) {
113 | item.animations.play('stand');
114 | }, this);
115 | gState.envObjects.redSlimes.forEachAlive(function(item) {
116 | item.animations.play('stand');
117 | }, this);
118 | gState.envObjects.arrows.forEachAlive(function(item) {
119 | item.animations.play('stand', 10, true);
120 | }, this);
121 |
122 | if(tntHandler.isExploding()){
123 | gState.envObjects.tnt.forEachAlive(function(item) {
124 | item.animations.play('exploding', 2, true);
125 | }, this);
126 | } else {
127 | gState.envObjects.tnt.forEachAlive(function(item) {
128 | item.animations.play('stand', 0, true);
129 | }, this);
130 | }
131 |
132 | // preventing "free move"
133 | gState.player.body.velocity.x = 0;
134 |
135 | gState.envObjects.trampolines.forEachAlive(function(item) {
136 | item.body.velocity.x = 0;
137 | }, this);
138 | gState.envObjects.fallers.forEachAlive(function(item) {
139 | item.body.velocity.x = 0;
140 | }, this);
141 | gState.envObjects.slowFallers.forEachAlive(function(item) {
142 | item.body.velocity.x = 0;
143 | item.body.velocity.y = 0;
144 | }, this);
145 |
146 | // controls
147 | let controlThreshold = 20;
148 |
149 | if ( gState.cursors.left.isDown ||
150 | (game.touchControl.cursors.left && (game.touchControl.speed.x > controlThreshold))){
151 | gState.player.body.velocity.x = -150;
152 | }
153 | else if ( gState.cursors.right.isDown ||
154 | (game.touchControl.cursors.right && (game.touchControl.speed.x < -controlThreshold))){
155 | gState.player.body.velocity.x = 150;
156 | }
157 | // jump!
158 | if ( (gState.cursors.up.isDown ||
159 | (game.touchControl.cursors.up && (game.touchControl.speed.y > controlThreshold)) ||
160 | gState.spaceKey.isDown ||
161 | gState.gamePad.justPressed(Phaser.Gamepad.XBOX360_A)) && gState.player.body.touching.down){
162 | game.add.tween( gState.player).to( { angle: 360 }, 600, Phaser.Easing.Linear.None, true);
163 |
164 | gState.emitters.juiceEmitters.spawnJumpEmitters();
165 | game.sound.play('jump');
166 | gState.player.body.velocity.y = -150;
167 |
168 | hardModeHandler.minusOne();
169 | }
170 |
171 | // overlaps
172 | let arcadePhysics = game.physics.arcade; // pass reference
173 |
174 | arcadePhysics.overlap( gState.player, gState.envObjects.lava, this.killPlayer, null, this);
175 | arcadePhysics.overlap( gState.player, gState.envObjects.trampolines, this.trampolinePlayer, null, this);
176 | arcadePhysics.overlap( gState.player, gState.envObjects.arrows, this.arrowBoost, null, this);
177 | arcadePhysics.overlap( gState.envObjects.redSlimes, gState.envObjects.arrows, this.arrowBoost, null, this);
178 |
179 | arcadePhysics.overlap( gState.envObjects.redSlimes, gState.envObjects.trampolines, this.trampolineSlime, null, this);
180 | arcadePhysics.overlap( gState.envObjects.redSlimes, gState.envObjects.lava, this.killRedSlime, null, this);
181 | arcadePhysics.overlap( gState.player, gState.envObjects.tnt, this.tntExplode, null, this);
182 | arcadePhysics.overlap( gState.envObjects.redSlimes, gState.envObjects.tnt, this.tntExplode, null, this);
183 |
184 | level.handleRidersLogic();
185 | level.handleSpecialLevelEvents();
186 |
187 | // gamepad controlls
188 | if (gState.gamePad.isDown(Phaser.Gamepad.XBOX360_DPAD_LEFT) || gState.gamePad.axis(Phaser.Gamepad.XBOX360_STICK_LEFT_X) < -0.1) {
189 | gState.player.body.velocity.x = -150;
190 | }
191 | else if (gState.gamePad.isDown(Phaser.Gamepad.XBOX360_DPAD_RIGHT) || gState.gamePad.axis(Phaser.Gamepad.XBOX360_STICK_LEFT_X) > 0.1) {
192 | gState.player.body.velocity.x = 150;
193 | }
194 |
195 | if(game.global.isHardMode && !level.isScoreLvl()){
196 | if(hardModeHandler.getJumpLimit() >= 0){
197 | hardModeJumpCounter.setText('Jumps left: ' + hardModeHandler.getJumpLimit());
198 | } else if(!gState.flags.isPlayerDead && !gState.flags.hasPlayerWon) {
199 | hardModeJumpCounter.setText('DEAD!');
200 | }
201 | }
202 | if(!level.isScoreLvl()){
203 | this.updateTimerLabel();
204 | }
205 | },
206 |
207 | updateTimerLabel: function(){
208 | let minutes = Math.floor(game.global.time / 60);
209 | let seconds = game.global.time % 60;
210 |
211 | let secondsString = '';
212 | if(seconds < 10){
213 | secondsString = '0' + seconds;
214 | } else {
215 | secondsString = '' + seconds;
216 | }
217 |
218 | let minutesString = '';
219 | if(minutes < 10){
220 | minutesString = '0' + minutes;
221 | } else {
222 | minutesString = '' + minutes;
223 | }
224 | timeCounterLabel.setText(minutesString +':' + secondsString);
225 | },
226 |
227 | arrowBoost: function( slime, arrow ){
228 | if(!gState.flags.hasPlayerWon){
229 | arrowBooster.boost( slime, arrow );
230 | }
231 | },
232 |
233 | initTnt: function(){
234 | gState.envObjects.tnt = null;
235 | level.addTnt();
236 | },
237 |
238 | tntExplode: function( slime, tnt){
239 | tntHandler.explode( tnt );
240 | },
241 |
242 | killPlayer: function(){
243 | if(!gState.flags.hasPlayerWon){
244 | this.shakeCamera();
245 | gState.emitters.juiceEmitters.spawnPlayerKillEmitters();
246 |
247 | gState.flags.isPlayerDead = true;
248 | game.sound.play('splash-death');
249 | gState.player.kill();
250 | setTimeout(function(){
251 | game.state.start('play');
252 | level.resetFancyLevelStuff();
253 | }, 600);
254 | }
255 | },
256 |
257 | killRedSlime: function(redSlime){
258 | if(!gState.flags.isPlayerDead){
259 |
260 | gState.emitters.juiceEmitters.spawnKillRedSlimeEmitters(redSlime);
261 |
262 | game.sound.play('splash-death');
263 | this.shakeCamera();
264 | redSlime.kill();
265 |
266 | level.checkForCoolKillText();
267 |
268 | if(gState.envObjects.redSlimes.countLiving() <= 0 && !gState.flags.hasPlayerWon){
269 | level.addEndingText(game, gState.player );
270 | gState.flags.hasPlayerWon = true;
271 | game.global.gameLevel++;
272 |
273 | setTimeout(function(){
274 |
275 | game.state.start('play');
276 |
277 | }, 3000);
278 | }
279 | }
280 |
281 | },
282 |
283 | shakeCamera: function(){
284 | game.camera.shake(0.01, 300);
285 | },
286 |
287 | initPlayer: function(){
288 | let g = gState;
289 | g.player = game.add.sprite(level.playerStartingX, level.playerStartingY, 'monster1');
290 | g.player.anchor.setTo(0.5,0.5);
291 | g.player.animations.add('stand', [0, 1, 2], 5, true);
292 | game.physics.arcade.enable( g.player );
293 | g.player.body.bounce.y = 0.2;
294 | g.player.body.gravity.y = 300;
295 | g.player.body.collideWorldBounds = true;
296 | },
297 |
298 | initPlatforms: function(){
299 | let env = gState.envObjects;
300 | level.addPlatforms( env.platforms );
301 | env.platforms.forEachAlive(function(item) {
302 | item.body.immovable = true;
303 | }, this);
304 | },
305 |
306 | initArrows: function(){
307 | let env = gState.envObjects;
308 | level.addArrows( env.arrows );
309 | env.arrows.forEachAlive(function(item) {
310 | item.body.immovable = true;
311 | item.animations.add('stand', [0, 1, 2, 3, 4, 5, 6]);
312 | }, this);
313 | },
314 |
315 | initTrampolines: function(){
316 | let env = gState.envObjects;
317 | game.physics.arcade.enable( env.trampolines );
318 | level.addTrampolines( env.trampolines );
319 | env.trampolines.forEachAlive(function(item) {
320 | item.body.bounce.y = 0.2;
321 | item.body.gravity.y = 300;
322 | item.body.collideWorldBounds = true;
323 | }, this);
324 | },
325 |
326 | initRiders: function(){
327 | let env = gState.envObjects;
328 | game.physics.arcade.enable( env.riders );
329 | level.addRiders( env.riders );
330 | env.riders.forEachAlive(function(item) {
331 | item.body.immovable = true;
332 | item.body.bounce.setTo(1, 1);
333 | item.body.collideWorldBounds = true;
334 | item.body.velocity.setTo(-100, 0);
335 | }, this);
336 | },
337 |
338 | initRedSlimes: function(){
339 | let e = gState.envObjects; //pass reference
340 | game.physics.arcade.enable( e.redSlimes );
341 |
342 | level.addRedSlimes( e.redSlimes);
343 | e.redSlimes.forEachAlive( function( item ) {
344 | item.body.bounce.y = 0.2;
345 | item.body.bounce.x = 1.0;
346 | item.body.gravity.y = 300;
347 | item.body.collideWorldBounds = true;
348 | item.animations.add('stand', [0, 1, 2], 5, true);
349 | }, this);
350 | },
351 |
352 | initSwitchFallers: function(){
353 | let env = gState.envObjects;
354 |
355 | level.addSwitchFallers();
356 | game.physics.arcade.enable( env.switchFallers );
357 |
358 | env.switchFallers.forEachAlive(function( item ) {
359 | item.body.immovable = true;
360 | }, this);
361 | },
362 |
363 | initFallers: function(){
364 | let env = gState.envObjects;
365 | level.addFallers( env.fallers );
366 | },
367 |
368 | initSlowFallers: function(){
369 | let env = gState.envObjects;
370 | level.addSlowFallers( env.slowFallers );
371 | },
372 |
373 |
374 | initLava: function(){
375 | let env = gState.envObjects;
376 | level.addLava( env.lava);
377 | env.lava.forEachAlive(function(item) {
378 | item.body.immovable = true;
379 | item.animations.add('stand', [0, 1], 2, true);
380 | }, this);
381 | },
382 |
383 | initRain: function(){
384 | game.global.rainSound.play();
385 | gState.emitters.rainEmitter = new RainEmitter();
386 | gState.emitters.rainEmitter.start();
387 | },
388 |
389 | trampolineSlime: function( redSlime ){
390 | redSlime.body.velocity.y -= 200;
391 | game.sound.play('trampoline_jump');
392 | },
393 |
394 | trampolinePlayer: function(){
395 | gState.player.body.velocity.y -= 200;
396 | game.sound.play('trampoline_jump');
397 | },
398 |
399 | initMobileControls: function(){
400 | game.touchControl = game.plugins.add(Phaser.Plugin.TouchControl);
401 | game.touchControl.inputEnable();
402 | game.touchControl.settings.singleDirection = false;
403 | },
404 |
405 | };
406 | module.exports = playState;
407 |
--------------------------------------------------------------------------------
/js/utils/booster.js:
--------------------------------------------------------------------------------
1 | import {GameState} from '../gameState'
2 | let g = new GameState().state;
3 | export class ArrowBooster{
4 |
5 | boost(slime, arrow){
6 | if( g.flags.canBoostFlag){
7 | var boostTween = game.add.tween(slime).to( { alpha: 0 }, 50, Phaser.Easing.Linear.None, true, 0, 1000, true);
8 |
9 | game.sound.play('ding');
10 |
11 | g.flags.canBoostFlag = false;
12 | let tempArrowX = arrow.x;
13 | let tempArrowY = arrow.y;
14 |
15 | arrow.kill();
16 |
17 | var l1 = game.add.text(slime.x - 8, slime.y - 30, '3!',
18 | {font: '20px Courier', fill: '#fff'});
19 |
20 | var l2, l3;
21 |
22 |
23 | setTimeout(function(){
24 | l1.kill();
25 | if(!g.flags.canBoostFlag){
26 | l2 = game.add.text(slime.x - 8, slime.y - 30, '2!',
27 | {font: '20px Courier', fill: '#fff'});
28 | }
29 |
30 | }, 1000);
31 |
32 | setTimeout(function(){
33 | l2.kill();
34 | if(!g.flags.canBoostFlag){
35 | l3 = game.add.text(slime.x - 8, slime.y - 30, '1!',
36 | {font: '20px Courier', fill: '#fff'});
37 | }
38 | }, 2000);
39 |
40 | setTimeout(function(){
41 | boostTween.stop();
42 | game.add.tween(slime).to( { alpha: 1 }, 500, Phaser.Easing.Linear.None, true);
43 |
44 | l3.kill();
45 |
46 | if(!g.flags.isPlayerDead && !g.flags.canBoostFlag){
47 | g.emitters.juiceEmitters.spawnBoostEmitters(slime);
48 | game.sound.play('ding-end');
49 | }
50 |
51 | g.flags.canBoostFlag = true;
52 | slime.body.velocity.y = -500;
53 |
54 | }, 2950);
55 |
56 | setTimeout(function(){
57 | arrow.reset(tempArrowX, tempArrowY);
58 | }, 8000);
59 | }
60 | }
61 |
62 | }
63 |
--------------------------------------------------------------------------------
/js/utils/collisions.js:
--------------------------------------------------------------------------------
1 | import {GameState} from '../gameState'
2 | let g = new GameState().state;
3 |
4 | export class CollisionsHandler{
5 |
6 | update(){
7 | game.physics.arcade.collide(g.player, g.envObjects.platforms);
8 | game.physics.arcade.collide(g.player, g.envObjects.riders);
9 | game.physics.arcade.collide(g.player, g.envObjects.fallers);
10 | game.physics.arcade.collide(g.player, g.envObjects.trampolines);
11 | game.physics.arcade.collide(g.player, g.envObjects.slowFallers);
12 | game.physics.arcade.collide(g.player, g.envObjects.switchFallers);
13 | game.physics.arcade.collide(g.envObjects.trampolines, g.envObjects.platforms);
14 | game.physics.arcade.collide(g.envObjects.trampolines, g.envObjects.trampolines);
15 | game.physics.arcade.collide(g.envObjects.slowFallers, g.envObjects.platforms);
16 | game.physics.arcade.collide(g.envObjects.tnt, g.envObjects.platforms);
17 | game.physics.arcade.collide(g.envObjects.tnt, g.envObjects.switchFallers);
18 | game.physics.arcade.collide(g.envObjects.redSlimes, g.envObjects.fallers);
19 | game.physics.arcade.collide(g.envObjects.redSlimes, g.envObjects.redSlimes);
20 | game.physics.arcade.collide(g.envObjects.redSlimes, g.envObjects.trampolines);
21 | game.physics.arcade.collide(g.envObjects.redSlimes, g.envObjects.switchFallers);
22 | game.physics.arcade.collide(g.player, g.envObjects.redSlimes);
23 | game.physics.arcade.collide(g.envObjects.platforms, g.envObjects.redSlimes);
24 | game.physics.arcade.collide(g.envObjects.redSlimes, g.envObjects.slowFallers);
25 | game.physics.arcade.collide(g.envObjects.slowFallers, g.envObjects.trampolines);
26 | game.physics.arcade.collide(g.envObjects.redSlimes, g.envObjects.riders);
27 | game.physics.arcade.collide(g.envObjects.trampolines, g.envObjects.riders);
28 | game.physics.arcade.collide(g.envObjects.trampolines, g.envObjects.switchFallers);
29 | game.physics.arcade.collide(g.envObjects.switchFallers, g.envObjects.switchFallers);
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/js/utils/emitters.js:
--------------------------------------------------------------------------------
1 | import {GameState} from '../gameState'
2 | let g = new GameState().state;
3 | export class RainEmitter{
4 |
5 | constructor() {
6 | this.emitter = game.add.emitter(game.world.centerX, 0, 400);
7 | this.initEmitter();
8 | }
9 |
10 | initEmitter(){
11 | this.emitter.width = game.world.width;
12 | this.emitter.angle = -3;
13 | this.emitter.makeParticles('rain');
14 |
15 | this.emitter.minParticleScale = 0.1;
16 | this.emitter.maxParticleScale = 0.5;
17 |
18 | this.emitter.setYSpeed(300, 500);
19 | this.emitter.setXSpeed(-5, 5);
20 |
21 | this.emitter.minRotation = 0;
22 | this.emitter.maxRotation = 0;
23 | }
24 |
25 | start(){
26 | this.emitter.start(false, 800, 5, 0);
27 | }
28 |
29 | }
30 |
31 | export class JuiceEmitters{
32 |
33 | spawnJumpEmitters(){
34 | this.emitter1 = game.add.emitter(0, 0, 100);
35 | this.emitter1.makeParticles('particle');
36 | this.emitter1.gravity = 200;
37 |
38 | this.emitter1.x = g.player.x;
39 | this.emitter1.y = g.player.y + 5;
40 | this.emitter1.start(true, 2000, null, 20);
41 | }
42 |
43 | spawnKillRedSlimeEmitters(redSlime){
44 | this.emitterRed = game.add.emitter(0, 0, 100);
45 | this.emitterRed.makeParticles('red-particle');
46 | this.emitterRed.gravity = 50;
47 | this.emitterRed.setScale(1.0, 0, 1.0, 0, 1500);
48 | this.emitterRed.x = redSlime.x + 15;
49 | this.emitterRed.y = redSlime.y + 25;
50 | this.emitterRed.start(true, 3000, null, 20);
51 | }
52 |
53 | spawnBoostEmitters(slime){
54 | this.emitter3 = game.add.emitter(0, 0, 100);
55 | this.emitter3.makeParticles('particle2');
56 | this.emitter3.gravity = 50;
57 | this.emitter3.setScale(1.0, 0, 1.0, 0, 2000);
58 |
59 | this.emitter3.x = slime.x;
60 | this.emitter3.y = slime.y;
61 | this.emitter3.start(true, 5000, null, 500);
62 | }
63 |
64 | spawnPlayerKillEmitters(){
65 | this.emitter2 = game.add.emitter(0, 0, 100);
66 | this.emitter2.makeParticles('particle2');
67 | this.emitter2.gravity = 50;
68 | this.emitter2.setScale(1.0, 0, 1.0, 0, 2000);
69 |
70 | this.emitter2.x = g.player.x + 15;
71 | this.emitter2.y = g.player.y + 25;
72 | this.emitter2.start(true, 600, null, 600);
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/js/utils/hardmode.js:
--------------------------------------------------------------------------------
1 |
2 | let jumpLimit = 666;
3 | let on = false;
4 | export class HardModeHandler{
5 |
6 | constructor(isOn) {
7 | this.on = isOn;
8 | }
9 |
10 | setJumpLimit(limit){
11 | jumpLimit = limit;
12 | }
13 |
14 | minusOne(){
15 | if(this.on){
16 | jumpLimit--;
17 | }
18 | }
19 |
20 | getJumpLimit(){
21 | return jumpLimit;
22 | }
23 |
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/js/utils/tnt.js:
--------------------------------------------------------------------------------
1 | import {GameState} from '../gameState'
2 | let g = new GameState().state;
3 | let exploding = false;
4 | export class TntHandler{
5 |
6 | explode(tnt){
7 | if(g.flags.canTntExplode){
8 | exploding = true;
9 |
10 | game.add.tween(tnt).to( { alpha: 0 }, 700, Phaser.Easing.Linear.None, true, 0, 1000, true);
11 | game.sound.play('tnt')
12 | g.flags.canTntExplode = false;
13 | var l1 = game.add.text(tnt.x + 11, tnt.y - 30, '3!',
14 | {font: '20px Courier', fill: '#fff'});
15 |
16 | var l2, l3;
17 |
18 | setTimeout(function(){
19 | l1.kill();
20 | l2 = game.add.text(tnt.x + 11, tnt.y - 30, '2!',
21 | {font: '20px Courier', fill: '#fff'});
22 | }, 1000);
23 |
24 | setTimeout(function(){
25 | l2.kill();
26 | l3 = game.add.text(tnt.x + 11, tnt.y - 30, '1!',
27 | {font: '20px Courier', fill: '#fff'});
28 |
29 | }, 2000);
30 |
31 | setTimeout(function(){
32 | game.camera.shake(0.04, 2000, true);
33 | l3.kill();
34 |
35 | setTimeout(function(){
36 | exploding = false;
37 | tnt.kill();
38 | }, 1000);
39 |
40 | g.envObjects.switchFallers.forEachAlive(function(item) {
41 | item.body.immovable = false;
42 | }, this);
43 |
44 | }, 3000);
45 | }
46 | }
47 |
48 | isExploding(){
49 | return exploding;
50 | }
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/old-prototype/assets/arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/old-prototype/assets/arrow.png
--------------------------------------------------------------------------------
/old-prototype/assets/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/old-prototype/assets/background.png
--------------------------------------------------------------------------------
/old-prototype/assets/background2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/old-prototype/assets/background2.png
--------------------------------------------------------------------------------
/old-prototype/assets/die.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/old-prototype/assets/die.mp3
--------------------------------------------------------------------------------
/old-prototype/assets/ding.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/old-prototype/assets/ding.mp3
--------------------------------------------------------------------------------
/old-prototype/assets/faller.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/old-prototype/assets/faller.png
--------------------------------------------------------------------------------
/old-prototype/assets/jump.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/old-prototype/assets/jump.mp3
--------------------------------------------------------------------------------
/old-prototype/assets/lava.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/old-prototype/assets/lava.png
--------------------------------------------------------------------------------
/old-prototype/assets/lava2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/old-prototype/assets/lava2.png
--------------------------------------------------------------------------------
/old-prototype/assets/menu.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/old-prototype/assets/menu.psd
--------------------------------------------------------------------------------
/old-prototype/assets/monster1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/old-prototype/assets/monster1.png
--------------------------------------------------------------------------------
/old-prototype/assets/monster2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/old-prototype/assets/monster2.png
--------------------------------------------------------------------------------
/old-prototype/assets/music.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/old-prototype/assets/music.mp3
--------------------------------------------------------------------------------
/old-prototype/assets/music2.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/old-prototype/assets/music2.mp3
--------------------------------------------------------------------------------
/old-prototype/assets/particle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/old-prototype/assets/particle.png
--------------------------------------------------------------------------------
/old-prototype/assets/particle2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/old-prototype/assets/particle2.png
--------------------------------------------------------------------------------
/old-prototype/assets/platform.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/old-prototype/assets/platform.png
--------------------------------------------------------------------------------
/old-prototype/assets/platform2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/old-prototype/assets/platform2.png
--------------------------------------------------------------------------------
/old-prototype/assets/rain.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/old-prototype/assets/rain.mp3
--------------------------------------------------------------------------------
/old-prototype/assets/rain.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/old-prototype/assets/rain.png
--------------------------------------------------------------------------------
/old-prototype/assets/red-particle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/old-prototype/assets/red-particle.png
--------------------------------------------------------------------------------
/old-prototype/assets/splash-death.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/old-prototype/assets/splash-death.mp3
--------------------------------------------------------------------------------
/old-prototype/assets/splash.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/old-prototype/assets/splash.mp3
--------------------------------------------------------------------------------
/old-prototype/assets/tnt.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/old-prototype/assets/tnt.mp3
--------------------------------------------------------------------------------
/old-prototype/assets/tnt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/old-prototype/assets/tnt.png
--------------------------------------------------------------------------------
/old-prototype/assets/tower1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/old-prototype/assets/tower1.png
--------------------------------------------------------------------------------
/old-prototype/assets/trampoline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/old-prototype/assets/trampoline.png
--------------------------------------------------------------------------------
/old-prototype/assets/trampoline_jump.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaDevMatt/EvilSlimeCity/071877b5f0306724d49357629b3260f98b872ff3/old-prototype/assets/trampoline_jump.mp3
--------------------------------------------------------------------------------
/old-prototype/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Evil Slime City v0.2 - old prototype
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/old-prototype/js/collisions.js:
--------------------------------------------------------------------------------
1 | class CollisionsHandler{
2 |
3 | update(){
4 | game.physics.arcade.collide(player, platforms);
5 | game.physics.arcade.collide(player, riders);
6 | game.physics.arcade.collide(player, fallers);
7 | game.physics.arcade.collide(player, slowFallers);
8 | game.physics.arcade.collide(player, switchFallers);
9 | game.physics.arcade.collide(slowFallers, platforms);
10 | game.physics.arcade.collide(tnt, platforms);
11 | game.physics.arcade.collide(tnt, switchFallers);
12 | game.physics.arcade.collide(redSlimes, riders);
13 | game.physics.arcade.collide(redSlimes, fallers);
14 | game.physics.arcade.collide(redSlimes, trampolines);
15 | game.physics.arcade.collide(redSlimes, slowFallers);
16 | game.physics.arcade.collide(redSlimes, switchFallers);
17 | game.physics.arcade.collide(player, redSlimes);
18 | game.physics.arcade.collide(platforms, redSlimes);
19 | game.physics.arcade.collide(player, trampolines);
20 | game.physics.arcade.collide(trampolines, platforms);
21 | game.physics.arcade.collide(slowFallers, trampolines);
22 | game.physics.arcade.collide(trampolines, trampolines);
23 | game.physics.arcade.collide(trampolines, switchFallers);
24 | game.physics.arcade.collide(switchFallers, switchFallers);
25 |
26 | }
27 |
28 | }
--------------------------------------------------------------------------------
/old-prototype/js/game.js:
--------------------------------------------------------------------------------
1 | var game = new Phaser.Game(640, 376, Phaser.AUTO, 'gameDiv');
2 | var music;
3 | var gameLevel = 1;
4 |
5 | game.state.add('init', initState);
6 | game.state.add('menu', menuState);
7 | game.state.add('play', playState);
8 |
9 | game.state.start('init');
10 |
--------------------------------------------------------------------------------
/old-prototype/js/init.js:
--------------------------------------------------------------------------------
1 | var initState = {
2 |
3 | preload: function(){
4 |
5 | var loadingLabel = game.add.text(20, 150, 'loading game data...',
6 | {font: '40px Courier', fill: '#fff'});
7 |
8 | // add content loadin here
9 | game.load.audio('music', 'assets/music.mp3'); // http://opengameart.org/content/rise-of-spirit
10 | game.load.audio('music2', 'assets/music2.mp3'); // http://opengameart.org/content/tragic-ambient-main-menu
11 |
12 |
13 | game.load.image('background', 'assets/background.png'); // http://opengameart.org/content/industrial-parallax-background
14 | game.load.image('background2', 'assets/background2.png');
15 | game.load.image('platform', 'assets/platform.png');
16 | game.load.image('platform2', 'assets/platform2.png');
17 | game.load.image('rain', 'assets/rain.png');
18 | game.load.image('tower1', 'assets/tower1.png');
19 | game.load.image('faller', 'assets/faller.png');
20 | game.load.image('particle', 'assets/particle.png');
21 | game.load.image('particle2', 'assets/particle2.png');
22 | game.load.image('red-particle', 'assets/red-particle.png');
23 | game.load.image('trampoline', 'assets/trampoline.png');
24 | game.load.image('arrow', 'assets/arrow.png');
25 | game.load.image('tnt', 'assets/tnt.png');
26 |
27 |
28 | game.load.spritesheet('monster1', 'assets/monster1.png', 30, 23); // http://opengameart.org/content/scifi-creature-tileset-mini-32x32-scifi-creature-icons
29 | game.load.spritesheet('monster2', 'assets/monster2.png', 30, 23);
30 | game.load.spritesheet('lava', 'assets/lava.png', 56, 32);
31 | game.load.spritesheet('lava2', 'assets/lava2.png', 252, 32);
32 |
33 | //
34 | game.load.audio('splash', 'assets/splash.mp3'); // http://opengameart.org/content/lava-splash
35 | game.load.audio('splash-death', 'assets/splash-death.mp3'); // http://freesound.org/people/Setuniman/sounds/135774/
36 | game.load.audio('ding', 'assets/ding.mp3'); // http://freesound.org/people/gloriaeffect/sounds/108428/
37 | game.load.audio('jump', 'assets/jump.mp3');
38 | game.load.audio('tnt', 'assets/tnt.mp3'); // http://freesound.org/people/ryansnook/sounds/110111/
39 | // http://freesound.org/people/theneedle.tv/sounds/316682/
40 |
41 | game.load.audio('rain', 'assets/rain.mp3'); // http://freesound.org/people/jmbphilmes/sounds/200272/
42 | game.load.audio('trampoline_jump', 'assets/trampoline_jump.mp3'); // http://freesound.org/people/arteffect/sounds/349854/
43 | game.load.audio('die', 'assets/die.mp3');
44 | },
45 |
46 | initStuff: function(){
47 | game.physics.startSystem(Phaser.Physics.ARCADE);
48 | },
49 |
50 | create: function() {
51 | this.initStuff();
52 |
53 | game.state.start('menu');
54 | }
55 |
56 | };
--------------------------------------------------------------------------------
/old-prototype/js/levels/level01.js:
--------------------------------------------------------------------------------
1 | class Level1{
2 |
3 | constructor() {
4 | this.playerStartingX = 10;
5 | this.playerStartingY = 10;
6 | }
7 |
8 | addStartingText(game){
9 | var loadingLabel = game.add.text(80, 278, 'Kill the evil slime!',
10 | {font: '20px Courier', fill: '#fff'});
11 | setTimeout(function(){
12 | loadingLabel.kill();
13 | }, 8000);
14 | }
15 |
16 | addEndingText(game, player){
17 | game.add.text(player.x - 200, 100, 'Great!',
18 | {font: '40px Courier', fill: '#fff'});
19 | game.add.text(player.x - 200, 136, 'Time for the next one....',
20 | {font: '20px Courier', fill: '#fff'});
21 | }
22 |
23 | createBackground(game){
24 | game.world.setBounds(0, 0, 885, 376);
25 |
26 | game.add.sprite(0, 0, 'background2');
27 | game.add.sprite(640, 0, 'background2');
28 | }
29 |
30 | addRedSlimes(redSlimes){
31 | redSlimes.create(670, 10, 'monster2');
32 | }
33 |
34 | addTrampolines(trampolines){
35 | trampolines.create(600, 270, 'trampoline');
36 | }
37 |
38 | addtPlatforms(platforms){
39 | platforms.create(0, 300, 'platform');
40 | platforms.create(197, 300, 'platform2');
41 | platforms.create(506, 300, 'platform');
42 | platforms.create(646, 300, 'platform');
43 | platforms.create(646, 112, 'tower1');
44 | }
45 |
46 | addKillers(killers){
47 | killers.create(141, 332, 'lava');
48 | killers.create(254, 332, 'lava2');
49 | killers.create(700, 332, 'lava2');
50 | }
51 |
52 | addArrows(arrows){
53 | // arrows.create(10, 270, 'arrow');
54 | }
55 |
56 | addFallers(fallers){
57 | fallers.create(340, 282, 'faller');
58 | }
59 |
60 | addSlowFallers(slowFallers){
61 | // slowFallers.create(120, 162, 'faller');
62 | }
63 |
64 | addRiders(riders){
65 | // riders.create(290, 50, 'faller');
66 | }
67 |
68 | handleRidersLogic(){
69 |
70 | }
71 | }
--------------------------------------------------------------------------------
/old-prototype/js/levels/level02.js:
--------------------------------------------------------------------------------
1 | class Level2{
2 |
3 | constructor() {
4 | this.rider1;
5 |
6 | this.playerStartingX = 10;
7 | this.playerStartingY = 10;
8 | }
9 |
10 |
11 | addStartingText(game){
12 | var levelLabel = game.add.text(110, 278, 'Kill 2 red evil slimes!',
13 | {font: '20px Courier', fill: '#fff'});
14 | setTimeout(function(){
15 | levelLabel.kill();
16 | }, 3000);
17 | }
18 |
19 | addEndingText(game, player){
20 | game.add.text(player.x - 200, 100, 'Nice!',
21 | {font: '40px Courier', fill: '#fff'});
22 | game.add.text(player.x - 200, 136, 'Get ready for more...',
23 | {font: '20px Courier', fill: '#fff'});
24 | }
25 |
26 | createBackground(game){
27 | game.world.setBounds(0, 0, 1705, 376);
28 |
29 | game.add.sprite(0, 0, 'background2');
30 | game.add.sprite(640, 0, 'background2');
31 | game.add.sprite(1280, 0, 'background2');
32 | }
33 |
34 | addRedSlimes(redSlimes){
35 | redSlimes.create(1470, 10, 'monster2');
36 | redSlimes.create(390, 70, 'monster2');
37 | }
38 |
39 | addTrampolines(trampolines){
40 | trampolines.create(50, 270, 'trampoline');
41 | trampolines.create(900, 270, 'trampoline');
42 | }
43 |
44 | addtPlatforms(platforms){
45 | platforms.create(754, 172, 'tower1');
46 | platforms.create(887, 300, 'platform');
47 | platforms.create(1028, 300, 'platform');
48 | platforms.create(1169, 300, 'platform');
49 | platforms.create(1169, 272, 'tower1');
50 | platforms.create(1310, 300, 'platform');
51 | platforms.create(1451, 300, 'platform');
52 | platforms.create(1410, 112, 'tower1');
53 |
54 | // platforms.create(754, 112, 'tower1');
55 | }
56 |
57 | addKillers(killers){
58 | killers.create(0, 332, 'lava2');
59 | killers.create(252, 332, 'lava2');
60 | killers.create(502, 332, 'lava2');
61 | killers.create(754, 332, 'lava2');
62 | killers.create(1510, 352, 'lava2');
63 |
64 | }
65 |
66 | addArrows(arrows){
67 | arrows.create(1230, 240, 'arrow');
68 | }
69 |
70 | addFallers(fallers){
71 | // fallers.create(20 282, 'faller');
72 | }
73 |
74 | addSlowFallers(slowFallers){
75 | slowFallers.create(20, 282, 'faller');
76 | }
77 |
78 | addRiders(riders){
79 | this.rider1 = riders.create(490, 200, 'faller');
80 | }
81 |
82 | handleRidersLogic(){
83 | if(this.rider1.x > 650){
84 | this.rider1.body.velocity.x = -100;
85 | }
86 | }
87 | }
--------------------------------------------------------------------------------
/old-prototype/js/levels/level03.js:
--------------------------------------------------------------------------------
1 | class Level3{
2 |
3 | constructor() {
4 | this.playerStartingX = 10;
5 | this.playerStartingY = 10;
6 | }
7 |
8 | addStartingText(game){
9 | var levelLabel = game.add.text(0, 0, 'Time to blow some shit up!',
10 | {font: '20px Courier', fill: '#fff'});
11 | setTimeout(function(){
12 | levelLabel.kill();
13 | }, 3000);
14 | }
15 |
16 | addEndingText(game, player){
17 | game.add.text(200, 100, 'Survived!',
18 | {font: '40px Courier', fill: '#fff'});
19 | game.add.text(200, 136, 'You lucky son of a slime!',
20 | {font: '20px Courier', fill: '#fff'});
21 | }
22 |
23 | createBackground(game){
24 | game.world.setBounds(0, 0, 640, 376);
25 |
26 | game.add.sprite(0, 0, 'background2');
27 | }
28 |
29 | addRedSlimes(redSlimes){
30 | redSlimes.create(350, 10, 'monster2');
31 | redSlimes.create(560, 10, 'monster2');
32 | }
33 |
34 | addTrampolines(trampolines){
35 | trampolines.create(160, 10, 'trampoline');
36 | }
37 |
38 | addtPlatforms(platforms){
39 | platforms.create(0, 112, 'tower1');
40 | platforms.create(1, 300, 'platform');
41 | platforms.create(421, 289, 'faller');
42 |
43 | }
44 |
45 | addKillers(killers){
46 | killers.create(142, 332, 'lava');
47 | killers.create(198, 332, 'lava');
48 | killers.create(254, 332, 'lava2');
49 | killers.create(506, 332, 'lava2');
50 |
51 |
52 | }
53 |
54 | addArrows(arrows){
55 | // arrows.create(10, 270, 'arrow');
56 | }
57 |
58 | addFallers(fallers){
59 | // fallers.create(340, 282, 'faller');
60 | }
61 |
62 | addSlowFallers(slowFallers){
63 | // slowFallers.create(120, 162, 'faller');
64 | }
65 |
66 | addRiders(riders){
67 | // riders.create(290, 50, 'faller');
68 | }
69 |
70 | handleRidersLogic(){
71 |
72 | }
73 | }
--------------------------------------------------------------------------------
/old-prototype/js/levels/level_prototype.js:
--------------------------------------------------------------------------------
1 | class LevelPrototype{
2 |
3 | constructor() {
4 | this.playerStartingX = 80;
5 | this.playerStartingY = 10;
6 |
7 | this.evilTwinStartingX = 560;
8 | this.evilTwinStartingY = 10;
9 | }
10 |
11 | addStartingText(game){
12 | // no text
13 | }
14 |
15 | createBackground(game){
16 | game.world.setBounds(0, 0, 1245, 376);
17 |
18 | game.add.sprite(0, 0, 'background2');
19 | game.add.sprite(640, 0, 'background2');
20 | }
21 |
22 | addTrampolines(trampolines){
23 | trampolines.create(240, 270, 'trampoline');
24 | trampolines.create(150, 50, 'trampoline');
25 | }
26 |
27 | addtPlatforms(platforms){
28 | platforms.create(0, 300, 'platform');
29 | platforms.create(197, 300, 'platform');
30 | platforms.create(506, 300, 'platform');
31 | platforms.create(646, 300, 'platform');
32 | platforms.create(787, 300, 'platform');
33 | platforms.create(928, 300, 'platform');
34 | platforms.create(1049, 300, 'platform');
35 | }
36 |
37 | addKillers(killers){
38 | killers.create(141, 332, 'lava');
39 | killers.create(338, 332, 'lava');
40 | killers.create(394, 332, 'lava');
41 | killers.create(450, 332, 'lava');
42 | killers.create(1190, 332, 'lava');
43 | }
44 |
45 | addArrows(arrows){
46 | arrows.create(10, 270, 'arrow');
47 | arrows.create(300, 270, 'arrow');
48 | }
49 |
50 | addFallers(fallers){
51 | fallers.create(420, 282, 'faller');
52 | }
53 |
54 | addSlowFallers(slowFallers){
55 | slowFallers.create(120, 162, 'faller');
56 | }
57 |
58 | addRiders(riders){
59 | riders.create(290, 50, 'faller');
60 | }
61 |
62 | handleRidersLogic(){
63 |
64 | }
65 | }
--------------------------------------------------------------------------------
/old-prototype/js/menu.js:
--------------------------------------------------------------------------------
1 | var menuState = {
2 |
3 |
4 | create: function() {
5 | if(music != null){
6 | music.stop();
7 | }
8 |
9 | music = game.sound.play('music');
10 | music.volume = 1.0;
11 | game.add.sprite(0, 0, 'background');
12 |
13 | monster1 = game.add.sprite(160, game.world.height-60, 'monster1');
14 | monster1.animations.add('stand', [0, 1, 2], 5, true);
15 |
16 | monster2 = game.add.sprite(430, game.world.height-60, 'monster1');
17 | monster2.animations.add('stand', [0, 1, 2], 5, true);
18 |
19 |
20 | var startLabel = game.add.text(200, game.world.height-60,
21 | 'press Space to start',
22 | {font: '25px Arial', fill: '#ffffff'});
23 |
24 | var spaceKey = game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR);
25 |
26 | spaceKey.onDown.addOnce(this.startGame, this);
27 | },
28 |
29 | update: function() {
30 | monster1.animations.play('stand');
31 | monster2.animations.play('stand');
32 | },
33 |
34 | startGame: function(){
35 | music.volume = 0.3;
36 | rain = game.sound.play('splash');
37 | rain.volume = 0.5;
38 | game.sound.play('rain');
39 | console.log('dummy startGame');
40 | game.state.start('play');
41 | },
42 |
43 | };
--------------------------------------------------------------------------------
/old-prototype/js/play.js:
--------------------------------------------------------------------------------
1 | var playState = {
2 |
3 | resetState: function(){
4 | window.canBoostFlag = true;
5 | window.canTntExplode = true;
6 | isDead = false;
7 | hasWon = false;
8 | },
9 |
10 | chooseLevel: function(){
11 | // return level = new Level2();
12 |
13 | if(gameLevel == 1){
14 | return level = new Level1();
15 | } else if(gameLevel == 2) {
16 | // music.stop();
17 | // music = game.sound.play('music2');
18 | return level = new Level2();
19 | } else {
20 | return level = new Level3();
21 | }
22 | },
23 |
24 | create: function() {
25 | level = this.chooseLevel();
26 |
27 | collisionsHandler = new CollisionsHandler();
28 |
29 | this.resetState();
30 | level.createBackground(game);
31 | level.addStartingText(game);
32 |
33 |
34 | this.initTnt();
35 | this.initPlayer();
36 | this.initRedSlimes();
37 | this.initTrampolines();
38 | this.initKillers();
39 | this.initPlatforms();
40 | this.initArrows();
41 | this.initFallers();
42 | this.initSlowFallers();
43 | this.initRiders();
44 | this.initEmitters();
45 | this.initRain();
46 | this.initSwitchFallers();
47 |
48 | cursors = game.input.keyboard.createCursorKeys();
49 |
50 | game.camera.follow(player);
51 |
52 | },
53 |
54 | shakeCamera: function(){
55 | game.camera.shake(0.01, 300);
56 | },
57 |
58 | update: function() {
59 |
60 | // collisios
61 | collisionsHandler.update()
62 |
63 | // animations
64 | player.animations.play('stand');
65 |
66 | redSlimes.forEachAlive(function(item) {
67 | item.animations.play('stand');
68 | }, this);
69 |
70 | killers.forEachAlive(function(item) {
71 | item.animations.play('stand');
72 | }, this);
73 |
74 | // preventing "free move"
75 | player.body.velocity.x = 0;
76 | trampolines.forEachAlive(function(item) {
77 | item.body.velocity.x = 0;
78 | }, this);
79 | fallers.forEachAlive(function(item) {
80 | item.body.velocity.x = 0;
81 | }, this);
82 | slowFallers.forEachAlive(function(item) {
83 | item.body.velocity.x = 0;
84 | item.body.velocity.y = 0;
85 | }, this);
86 |
87 | // controls
88 | if (cursors.left.isDown){
89 | player.body.velocity.x = -150;
90 | }
91 | else if (cursors.right.isDown){
92 | player.body.velocity.x = 150;
93 | }
94 | if (cursors.up.isDown && player.body.touching.down){
95 | game.add.tween(player).to( { angle: 360 }, 600, Phaser.Easing.Linear.None, true);
96 |
97 | game.sound.play('jump');
98 | player.body.velocity.y = -150;
99 |
100 | emitter.x = player.x;
101 | emitter.y = player.y + 5;
102 | emitter.start(true, 2000, null, 20);
103 | }
104 |
105 | if(player.body.touching.down && player.body.velocity.x != 0){
106 | emitter.x = player.x;
107 | emitter.y = player.y + 15;
108 |
109 | emitter.start(true, 100, null, 1);
110 | }
111 | // overlaps
112 | game.physics.arcade.overlap(player, killers, this.die, null, this);
113 | game.physics.arcade.overlap(redSlimes, killers, this.killRedSlime, null, this);
114 | game.physics.arcade.overlap(player, trampolines, this.trampolinePlayer, null, this);
115 | game.physics.arcade.overlap(redSlimes, trampolines, this.trampolineSlime, null, this);
116 | game.physics.arcade.overlap(player, arrows, this.arrowBoost, null, this);
117 | game.physics.arcade.overlap(player, tnt, this.tntExplode, null, this);
118 | game.physics.arcade.overlap(redSlimes, tnt, this.tntExplode, null, this);
119 |
120 | level.handleRidersLogic();
121 | },
122 |
123 | tntExplode: function(){
124 | if(window.canTntExplode){
125 | game.add.tween(tnt).to( { alpha: 0 }, 700, Phaser.Easing.Linear.None, true, 0, 1000, true);
126 | game.sound.play('tnt')
127 | window.canTntExplode = false;
128 | var l1 = game.add.text(tnt.x + 11, tnt.y - 30, '3!',
129 | {font: '20px Courier', fill: '#fff'});
130 |
131 | var l2, l3;
132 |
133 | setTimeout(function(){
134 | l1.kill();
135 | l2 = game.add.text(tnt.x + 11, tnt.y - 30, '2!',
136 | {font: '20px Courier', fill: '#fff'});
137 | }, 1000);
138 |
139 | setTimeout(function(){
140 | l2.kill();
141 | l3 = game.add.text(tnt.x + 11, tnt.y - 30, '1!',
142 | {font: '20px Courier', fill: '#fff'});
143 | }, 2000);
144 |
145 | setTimeout(function(){
146 | game.camera.shake(0.04, 2000, true);
147 | l3.kill();
148 |
149 | setTimeout(function(){
150 | tnt.kill();
151 | }, 1000);
152 |
153 | switchFallers.forEachAlive(function(item) {
154 | item.body.immovable = false;
155 | }, this);
156 |
157 | }, 3000);
158 | }
159 |
160 | },
161 |
162 | arrowBoost: function(player, arrow){
163 | if(window.canBoostFlag){
164 | boostTween = game.add.tween(player).to( { alpha: 0 }, 50, Phaser.Easing.Linear.None, true, 0, 1000, true);
165 | game.sound.play('ding')
166 | window.canBoostFlag = false;
167 | arrow.kill();
168 |
169 | var l1 = game.add.text(player.x - 8, player.y - 30, '3!',
170 | {font: '20px Courier', fill: '#fff'});
171 |
172 | var l2, l3;
173 |
174 | setTimeout(function(){
175 | l1.kill();
176 | l2 = game.add.text(player.x - 8, player.y - 30, '2!',
177 | {font: '20px Courier', fill: '#fff'});
178 | }, 1000);
179 |
180 | setTimeout(function(){
181 | l2.kill();
182 | l3 = game.add.text(player.x - 8, player.y - 30, '1!',
183 | {font: '20px Courier', fill: '#fff'});
184 | }, 2000);
185 |
186 | setTimeout(function(){
187 | boostTween.stop();
188 | game.add.tween(player).to( { alpha: 1 }, 500, Phaser.Easing.Linear.None, true);
189 |
190 | l3.kill();
191 | emitter2.x = player.x;
192 | emitter2.y = player.y;
193 |
194 | emitter2.start(true, 5000, null, 500);
195 |
196 | window.canBoostFlag = true;
197 | player.body.velocity.y = -500;
198 | }, 3000);
199 | }
200 |
201 | },
202 |
203 | trampolineSlime: function(redSlime){
204 | redSlime.body.velocity.y -= 200;
205 | game.sound.play('trampoline_jump');
206 | },
207 |
208 | trampolinePlayer: function(){
209 | player.body.velocity.y -= 200;
210 | game.sound.play('trampoline_jump');
211 | },
212 |
213 | die: function(){
214 | if(!hasWon){
215 | this.shakeCamera();
216 | emitter2.x = player.x + 15;
217 | emitter2.y = player.y + 25;
218 | emitter2.start(true, 600, null, 600);
219 |
220 | isDead = true;
221 | game.sound.play('splash-death');
222 | player.kill();
223 | setTimeout(function(){
224 | game.state.start('play');
225 | }, 600);
226 | }
227 | },
228 |
229 | killRedSlime: function(redSlime){
230 | if(!isDead){
231 | emitterRed.x = redSlime.x + 15;
232 | emitterRed.y = redSlime.y + 25;
233 | emitterRed.start(true, 3000, null, 20);
234 |
235 |
236 | game.sound.play('splash-death');
237 | this.shakeCamera();
238 | redSlime.kill();
239 |
240 | if(level instanceof Level2 && redSlimes.countLiving() == 1){
241 | var infoLabel = game.add.text(310, 278, 'One more!',
242 | {font: '20px Courier', fill: '#fff'});
243 | setTimeout(function(){
244 | infoLabel.kill();
245 | }, 3000);
246 | }
247 |
248 | if(redSlimes.countLiving() <= 0){
249 |
250 | level.addEndingText(game, player);
251 |
252 | hasWon = true;
253 | gameLevel++;
254 | setTimeout(function(){
255 | if(gameLevel >= 4){
256 | gameLevel = 1;
257 | game.state.start('menu');
258 | } else {
259 | game.state.start('play');
260 | }
261 |
262 | }, 3000);
263 |
264 | }
265 | }
266 |
267 | },
268 |
269 | initPlayer: function(){
270 | player = game.add.sprite(level.playerStartingX, level.playerStartingY, 'monster1');
271 | player.anchor.setTo(0.5,0.5);
272 | player.animations.add('stand', [0, 1, 2], 5, true);
273 | game.physics.arcade.enable(player);
274 | player.body.bounce.y = 0.2;
275 | player.body.gravity.y = 300;
276 | player.body.collideWorldBounds = true;
277 | },
278 |
279 | initRedSlimes: function(){
280 | redSlimes = game.add.group();
281 |
282 | redSlimes.enableBody = true;
283 | game.physics.arcade.enable(redSlimes);
284 |
285 | level.addRedSlimes(redSlimes);
286 | redSlimes.forEachAlive(function(item) {
287 | item.body.bounce.y = 0.2;
288 | item.body.bounce.x = 1.0;
289 | item.body.gravity.y = 300;
290 | item.body.collideWorldBounds = true;
291 | item.animations.add('stand', [0, 1, 2], 5, true);
292 | }, this);
293 |
294 |
295 | },
296 |
297 | initTrampolines: function(){
298 | trampolines = game.add.group();
299 | trampolines.enableBody = true;
300 | game.physics.arcade.enable(trampolines);
301 | level.addTrampolines(trampolines);
302 | trampolines.forEachAlive(function(item) {
303 | item.body.bounce.y = 0.2;
304 | item.body.gravity.y = 300;
305 | item.body.collideWorldBounds = true;
306 | }, this);
307 | },
308 |
309 | initPlatforms: function(){
310 | platforms = game.add.group();
311 | platforms.enableBody = true;
312 | level.addtPlatforms(platforms);
313 | platforms.forEachAlive(function(item) {
314 | item.body.immovable = true;
315 | }, this);
316 | },
317 |
318 | initKillers: function(){
319 | killers = game.add.group();
320 | killers.enableBody = true;
321 | level.addKillers(killers);
322 | killers.forEachAlive(function(item) {
323 | item.body.immovable = true;
324 | item.animations.add('stand', [0, 1], 2, true);
325 | }, this);
326 | },
327 |
328 | initArrows: function(){
329 | arrows = game.add.group();
330 | arrows.enableBody = true;
331 | level.addArrows(arrows);
332 | arrows.forEachAlive(function(item) {
333 | item.body.immovable = true;
334 | }, this);
335 | },
336 |
337 | initFallers: function(){
338 | fallers = game.add.group();
339 | fallers.enableBody = true;
340 | level.addFallers(fallers);
341 | },
342 |
343 | initSlowFallers: function(){
344 | slowFallers = game.add.group();
345 | slowFallers.enableBody = true;
346 | level.addSlowFallers(slowFallers);
347 | },
348 |
349 | initRiders: function(){
350 | riders = game.add.group();
351 | riders.enableBody = true;
352 | game.physics.arcade.enable(riders);
353 | level.addRiders(riders);
354 | riders.forEachAlive(function(item) {
355 | item.body.immovable = true;
356 | item.body.bounce.setTo(1, 1);
357 | item.body.collideWorldBounds = true;
358 | item.body.velocity.setTo(-100, 0);
359 | }, this);
360 | },
361 |
362 | initEmitters: function(){
363 | emitter = game.add.emitter(0, 0, 100);
364 | emitter.makeParticles('particle');
365 | emitter.gravity = 200;
366 |
367 | emitter2 = game.add.emitter(0, 0, 100);
368 | emitter2.makeParticles('particle2');
369 | emitter2.gravity = 50;
370 | emitter2.setScale(1.0, 0, 1.0, 0, 2000);
371 |
372 | emitterRed = game.add.emitter(0, 0, 100);
373 | emitterRed.makeParticles('red-particle');
374 | emitterRed.gravity = 50;
375 | emitterRed.setScale(1.0, 0, 1.0, 0, 1500);
376 | },
377 |
378 | initTnt: function(){
379 | if(gameLevel == 3){
380 | tnt = game.add.sprite(360, 150, 'tnt');
381 | game.physics.arcade.enable(tnt);
382 | tnt.body.bounce.y = 0.2;
383 | tnt.body.gravity.y = 300;
384 | tnt.body.collideWorldBounds = true;
385 | } else {
386 | tnt = null;
387 | }
388 | },
389 |
390 | initSwitchFallers: function(){
391 | switchFallers = game.add.group();
392 | if(gameLevel == 3){
393 | switchFallers.enableBody = true;
394 | game.physics.arcade.enable(switchFallers);
395 | switchFallers.create(136, 242, 'faller');
396 | switchFallers.create(330, 112, 'faller');
397 |
398 | switchFallers.create(208, 242, 'platform');
399 | switchFallers.create(349, 289, 'faller');
400 | switchFallers.create(493, 289, 'faller');
401 | switchFallers.create(565, 289, 'faller');
402 | switchFallers.create(530, 32, 'tower1');
403 |
404 | switchFallers.forEachAlive(function(item) {
405 | item.body.immovable = true;
406 | }, this);
407 | }
408 | },
409 |
410 | initRain: function(){
411 | rainEmitter = game.add.emitter(game.world.centerX, 0, 400);
412 | rainEmitter.width = game.world.width;
413 | rainEmitter.angle = -3;
414 | rainEmitter.makeParticles('rain');
415 |
416 | rainEmitter.minParticleScale = 0.1;
417 | rainEmitter.maxParticleScale = 0.5;
418 |
419 | rainEmitter.setYSpeed(300, 500);
420 | rainEmitter.setXSpeed(-5, 5);
421 |
422 | rainEmitter.minRotation = 0;
423 | rainEmitter.maxRotation = 0;
424 |
425 | rainEmitter.start(false, 800, 5, 0);
426 | },
427 |
428 |
429 | };
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "evil_slime_city",
3 | "version": "0.9.0",
4 | "description": "Html 5 game",
5 | "main": "index.js",
6 | "dependencies": {
7 | "lodash": "^4.17.4"
8 | },
9 | "devDependencies": {
10 | "@orange-games/phaser-input": "^2.0.5",
11 | "babel-preset-es2015": "^6.24.0",
12 | "babelify": "^7.3.0",
13 | "browser-sync": "^2.11.1",
14 | "browserify": "^13.0.0",
15 | "buffer": "^4.5.0",
16 | "gulp": "^3.9.1",
17 | "gulp-sourcemaps": "^1.6.0",
18 | "gulp-uglify": "^1.5.3",
19 | "gulp-util": "^3.0.7",
20 | "gutil": "^1.6.4",
21 | "reactify": "^1.1.1",
22 | "source": "0.0.3",
23 | "uglify": "^0.1.5",
24 | "vinyl-buffer": "^1.0.0",
25 | "vinyl-source-stream": "^1.1.0"
26 | },
27 | "scripts": {
28 | "start": "./node_modules/.bin/gulp serve",
29 | "editMode": "./node_modules/.bin/gulp serve && node server.js"
30 | },
31 | "repository": {
32 | "type": "git",
33 | "url": "git+https://github.com/JavaDevMatt/EvilSlimeCity.git"
34 | },
35 | "keywords": [
36 | "Evil",
37 | "Slime",
38 | "City",
39 | "Game",
40 | "Html5",
41 | "phaser",
42 | "JavaDevMatt"
43 | ],
44 | "author": [
45 | {
46 | "name": "JavaDevMatt",
47 | "website": "https://github.com/JavaDevMatt"
48 | }
49 | ],
50 | "contributors": [
51 | {
52 | "name": "Tomasz Rekawek",
53 | "website": "https://github.com/tomasz-rekawek",
54 | "email": "tomasz@rekawek.com"
55 | },
56 | {
57 | "name": "Adam Pajkert",
58 | "website": "https://github.com/pajadam",
59 | "email": "contact@pajadam.me"
60 | }
61 | ],
62 | "license": "ISC",
63 | "bugs": {
64 | "url": "https://github.com/JavaDevMatt/EvilSlimeCity/issues"
65 | },
66 | "homepage": "https://github.com/JavaDevMatt/EvilSlimeCity#readme"
67 | }
68 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | # Evil Slime City
2 |
3 | Play the current game version here: http://mkupilas.civ.pl/esc/devlog11/
4 |
5 | ## System requirements
6 | This app require `npm >= 6.9`
7 |
8 | ## Running
9 | Install application dependencies:
10 | - `npm install`
11 |
12 | Run development server:
13 | - `npm start`
14 |
15 | Now you can view changes live using your browser at `localhost:3000`.
--------------------------------------------------------------------------------
/server.js:
--------------------------------------------------------------------------------
1 | var http = require("http"),
2 | url = require("url"),
3 | fs = require("fs")
4 | port = process.argv[2] || 8888;
5 |
6 | http.createServer(function(request, response) {
7 |
8 | var uri = url.parse(request.url).pathname;
9 | var body = [];
10 | request.on('data', function(chunk) {
11 | body.push(chunk);
12 | }).on('end', function() {
13 | body = Buffer.concat(body).toString();
14 |
15 | try {
16 | console.log( 'try' );
17 | console.log( body );
18 | var bodyJson = JSON.parse( body );
19 | console.log( 'body' );
20 | console.log( bodyJson );
21 | var filePath = bodyJson.path;
22 | var content = bodyJson.content;
23 | } catch( err ) {
24 | response.writeHead(500,
25 | {
26 | "Content-Type": "application/json",
27 | "Access-Control-Allow-Origin" : "*"
28 | });
29 | response.write( JSON.stringify({
30 | "sucess": false,
31 | "msg": "Unsupproted json format",
32 | }) );
33 | response.end();
34 | return 0;
35 | }
36 | console.log( filePath );
37 | fs.writeFile( 'js/levels/structures/' + filePath, 'module.exports = ' + JSON.stringify( content, null, 4 ), function(err) {
38 | if(err) {
39 | response.writeHead(500, {"Content-Type": "application/json", "Access-Control-Allow-Origin" : "*"});
40 | response.write( JSON.stringify({
41 | "sucess": false,
42 | "msg": "cannot save a file",
43 | }) );
44 | return console.log(err);
45 | }
46 | response.writeHead(200, {"Content-Type": "application/json", "Access-Control-Allow-Origin" : "*"});
47 | response.write( JSON.stringify({
48 | "sucess": true,
49 | "msg": "file saved",
50 | }) );
51 | response.end();
52 | console.log("The file was saved!");
53 | });
54 | });
55 |
56 | return;
57 | }).listen(parseInt(port, 10));
58 |
59 | console.log("Static file server running at\n => http://localhost:" + port + "/\nCTRL + C to shutdown");
60 |
--------------------------------------------------------------------------------