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

Loading…
Cancel
Save