diff --git a/docs/assets/images/epic.png b/docs/assets/images/epic.png new file mode 100644 index 0000000..763a329 Binary files /dev/null and b/docs/assets/images/epic.png differ diff --git a/docs/assets/images/level_2.png b/docs/assets/images/level_2.png deleted file mode 100644 index b2bd9ef..0000000 Binary files a/docs/assets/images/level_2.png and /dev/null differ diff --git a/docs/assets/js/constants.js b/docs/assets/js/constants.js index f2c99ce..9dd1a8a 100644 --- a/docs/assets/js/constants.js +++ b/docs/assets/js/constants.js @@ -50,15 +50,16 @@ var constants = { leg_speed: 0.1, movement_divider: 50, max_movement_speed: 3, - width: 30, - height: 50, + width: 40, + height: 75, select_range: 10, + leg_length: 75, hip: { - offset_x: 15, - offset_y: 25 + offset_x: 20, + offset_y: 35 }, defaultX: 500, - defaultY: -70 + defaultY: -170 } }; \ No newline at end of file diff --git a/docs/assets/js/index.js b/docs/assets/js/index.js index 87a7cfc..2f441f9 100644 --- a/docs/assets/js/index.js +++ b/docs/assets/js/index.js @@ -5,7 +5,7 @@ page_preloader.show(true); images = [ "assets/images/", "level.png", - "level_2.png", + "epic.png", "heartCover.png", "heartBack.png", "blinkOverlay.png", @@ -80,8 +80,8 @@ function draw() { if(!justBlinked) { camera.zoom = 1; + imgIgnoreCutoff(sprites.epic,0,0); drawWorldBlocks(); - imgIgnoreCutoff(sprites.level_2,0,0,0,4,4); player.draw(); } else { @@ -99,7 +99,7 @@ function draw() { break; //building - to be used only in development case globalStates.building: - + imgIgnoreCutoff(sprites.epic,0,0); buildDraw(); break; } diff --git a/docs/assets/js/player/player.js b/docs/assets/js/player/player.js index 2ce5929..47a8ac3 100644 --- a/docs/assets/js/player/player.js +++ b/docs/assets/js/player/player.js @@ -6,8 +6,8 @@ class Player { this.h = constants.player.height; this.hipLeft = { x: this.x + constants.player.hip.offset_x, y: this.y + constants.player.hip.offset_y }; this.hipRight = { x: this.x - constants.player.hip.offset_x, y: this.y + constants.player.hip.offset_y }; - this.leftLeg = new Leg(this.hipLeft.x, this.hipLeft.y, 50, Math.PI*2.5); - this.rightLeg = new Leg(this.hipRight.x, this.hipRight.y, 50, Math.PI*2.5); + this.leftLeg = new Leg(this.hipLeft.x, this.hipLeft.y, constants.player.leg_length, Math.PI*2.5); + this.rightLeg = new Leg(this.hipRight.x, this.hipRight.y, constants.player.leg_length, Math.PI*2.5); this.legSelected = "R"; this.shouldMoveLeg = false; this.collided = false; @@ -75,8 +75,35 @@ Player.prototype.update = function() { } } } + + // god mode + // if(keyDown[k.w]) { + // this.y-=5; + // } + // if(keyDown[k.s]) { + // this.y+=5; + // } + // if(keyDown[k.a]) { + // this.x-=5; + // } + // if(keyDown[k.d]) { + // this.x+=5; + // } centerCameraOn(this.x,this.y); + // camera limits + if(camera.x > 898) { + camera.x = 898; + } + if(camera.x < -98) { + camera.x = -98; + } + if(camera.y < 245) { + camera.y = 245; + } + if(camera.y > 350) { + camera.y = 350; + } } diff --git a/docs/assets/js/transition/transition.js b/docs/assets/js/transition/transition.js index b1d566f..c7e8d75 100644 --- a/docs/assets/js/transition/transition.js +++ b/docs/assets/js/transition/transition.js @@ -24,7 +24,7 @@ function drawLevelTransitionUI() { // draws background sprites drawWorldBlocks(); - imgIgnoreCutoff(sprites.level_2,0,0,0,4,4); + imgIgnoreCutoff(sprites.epic,0,0); player.draw(); // sets alpha to calculated alpha for black diff --git a/docs/assets/js/world/level.js b/docs/assets/js/world/level.js index fe6f783..265b892 100644 --- a/docs/assets/js/world/level.js +++ b/docs/assets/js/world/level.js @@ -12,7 +12,7 @@ class block { } // create blocks -var blockData = [942,-184,94,507,942,191,94,507,372,411,1054,67,-316,369,1214,152,-38,270,86,107,-166,243,125,127,238,320,45,127,273,284,45,127,309,248,45,127,341,215,45,127,377,179,45,127,412,143,45,127,450,107,45,127,603,105,285,196,777,27,285,196,-989,23,175,959,154,-441,2555,51]; +var blockData = [705,-8,491,64,460,27,74,64,425,64,74,64,389,99,74,64,352,135,74,64,321,167,74,64,285,203,74,64,249,239,74,64,-18,299,3314,111,-43,205,59,90,-44,207,80,63,-168,199,128,108,-168,144,158,25,-978,-101,158,984,14,-398,1958,85,928,-192,58,345,664,-101,25,133,867,-102,25,133,765,-97,185,67]; for (let i = 0, l = blockData.length; i < l; i += 4) { collisionRects.push(new block(blockData[i], blockData[i + 1], blockData[i + 2], blockData[i + 3])); }