Browse Source

fishy fix;

master
Nero Ignis 3 years ago
parent
commit
566243ee4a
  1. 15
      js/app.js

15
js/app.js

@ -7,8 +7,8 @@ const FishApp = { @@ -7,8 +7,8 @@ const FishApp = {
return {
force: 0,
pull: false,
pullRate: 1.5,
dropRate: 2.5,
pullRate: 2,
dropRate: 3,
intervalID: null,
fishMovementIntervalID: null,
fishy: null,
@ -17,7 +17,7 @@ const FishApp = { @@ -17,7 +17,7 @@ const FishApp = {
name: 'Freddy the fishy',
strength: 3,
quirkyness: 10,
points: 100,
points: 10,
position: 0,
sprite: './assets/fishTile_074.png'
}
@ -61,18 +61,17 @@ const FishApp = { @@ -61,18 +61,17 @@ const FishApp = {
this.fishy.position = 0;
this.fishMovementIntervalID = setInterval(() => {
let up = Math.floor(Math.random() * 100) < 10;
console.log(up);
let up = Math.floor(Math.random() * 101) <= 55;
if (up) {
if (vue.fishy.position < 250) {
vue.fishy.position += vue.fishy.quirkyness;
} else {
vue.fishy.position -= vue.fishy.quirkyness * 4;
vue.fishy.position -= vue.fishy.quirkyness;
}
} else {
if (vue.fishy.position < 0) {
vue.fishy.position = Number(vue.fishy.position) - (vue.fishy.quirkyness * 4);
if (vue.fishy.position >= vue.fishy.quirkyness) {
vue.fishy.position = Number(vue.fishy.position) - vue.fishy.quirkyness;
}
}
}, 100);

Loading…
Cancel
Save