more tutorial cus my mom was confuesd
This commit is contained in:
parent
aea12aeaa2
commit
db800eea27
BIN
docs/assets/images/turn.png
Normal file
BIN
docs/assets/images/turn.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 243 B |
@ -156,11 +156,11 @@ function heartBeatUI(x, y, width, height) {
|
||||
//Backdrop
|
||||
var BackdropColor;
|
||||
if (pressure > 42 && pressure < 60) {
|
||||
BackdropColor = "#0c2605";
|
||||
BackdropColor = "#398026";
|
||||
} else if (pressure > 28 && pressure < 75) {
|
||||
BackdropColor = "#2b2b06";
|
||||
BackdropColor = "#9e9e2e";
|
||||
} else {
|
||||
BackdropColor = "#260505";
|
||||
BackdropColor = "#d42828";
|
||||
}
|
||||
rect(x + width / 2, y + height / 2, width, height, BackdropColor);
|
||||
img(sprites.heartBack, cw - 107, ch - 46 + playingUIOffsets.heart);
|
||||
|
@ -59,7 +59,7 @@ var constants = {
|
||||
offset_x: 16,
|
||||
offset_y: 35
|
||||
},
|
||||
defaultX: 575,
|
||||
defaultX: 535,
|
||||
defaultY: -155
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,8 @@ images = [
|
||||
"buttonBig.png",
|
||||
"buttonSmallHover.png",
|
||||
"buttonSmall.png",
|
||||
"backGround.png"
|
||||
"backGround.png",
|
||||
"turn.png"
|
||||
];
|
||||
|
||||
audio = [
|
||||
|
@ -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, 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.leftLeg = new Leg(this.hipLeft.x, this.hipLeft.y, constants.player.leg_length, 1.5);
|
||||
this.rightLeg = new Leg(this.hipRight.x, this.hipRight.y, constants.player.leg_length, 1.5);
|
||||
this.leftArm = new Arm(this.hipLeft.x + 8, this.y - constants.player.hip.offset_y, 64, Math.PI/2);
|
||||
this.rightArm = new Arm(this.hipRight.x - 8, this.y - constants.player.hip.offset_y, 64, Math.PI/2);
|
||||
this.head = {x:this.x,y:this.y-this.h/2,angle:Math.PI*1.5};
|
||||
@ -180,6 +180,10 @@ Player.prototype.moveLeg = function(){
|
||||
|
||||
// console.log(curLeg.angle.toPrecision(5),pointTo(curLeg,target).toPrecision(5));
|
||||
var angleDif = turn(curLeg.angle, pointTo(curLeg, target), constants.player.leg_speed) - curLeg.angle;
|
||||
if(Math.abs(angleDif) > 1) {
|
||||
curLeg.angle = pointTo(curLeg, target);
|
||||
angleDif = 0;
|
||||
}
|
||||
curLeg.angle += angleDif;
|
||||
curLeg.x2 = curLeg.x + curLeg.len * Math.cos(curLeg.angle);
|
||||
curLeg.y2 = curLeg.y + curLeg.len * Math.sin(curLeg.angle);
|
||||
|
@ -101,6 +101,18 @@ function drawPlaying() {
|
||||
|
||||
// drawWorldBlocks();
|
||||
player.draw();
|
||||
|
||||
if(player.shouldMoveLeg) {
|
||||
curCtx.globalAlpha = 0.3;
|
||||
curCtx.lineCap = "round";
|
||||
curCtx.shadowColor = "yellow";
|
||||
curCtx.shadowBlur = 10;
|
||||
line(player.x,player.y,mousePosition().x,mousePosition().y,2*clamp(dist(player.getActiveLeg(), mousePosition()) / constants.player.movement_divider, 0.1, constants.player.max_movement_speed),"#baba30");
|
||||
curCtx.shadowBlur = 0;
|
||||
curCtx.shadowColor = "black";
|
||||
curCtx.lineCap = "butt";
|
||||
curCtx.globalAlpha = 1;
|
||||
}
|
||||
|
||||
// beat key
|
||||
if(keyPrompts.beat > 0 && playingUIOffsets.heart === 0) {
|
||||
@ -127,7 +139,8 @@ function drawPlaying() {
|
||||
img(sprites["tutSelect"+~~(frameCount/10)%2],(player.leftLeg.x+player.leftLeg.x2)/2,(player.leftLeg.y+player.leftLeg.y2)/2,0,2,2);
|
||||
break;
|
||||
case tutorialStates.placeOnGround:
|
||||
img(sprites["tutSelect"+~~(frameCount/10)%2],500,-40,2,2);
|
||||
img(sprites["tutSelect"+~~(frameCount/10)%2],430,-10,0,2,2);
|
||||
img(sprites.turn,560,-140,(~~(frameCount/10)%2) / 4,2,2);
|
||||
break;
|
||||
case tutorialStates.goDownStairs:
|
||||
img(sprites.tutArrow,360+~~(frameCount/10)%2,-30-~~(frameCount/10)%2,0,2,2);
|
||||
|
Reference in New Issue
Block a user