Skip to content

Commit

Permalink
Fix for vertically enhanced devices
Browse files Browse the repository at this point in the history
  • Loading branch information
roboyeti committed Jan 5, 2023
1 parent 05e7f62 commit e2f2ae9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
3 changes: 2 additions & 1 deletion fx/fireworks/fireworks.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ class Fireworks extends Phaser.Scene {
create() {
this.firework = this.add.particles('sparks');
this.bomb = this.add.particles('sparks');
var offset = this.h > 1080 ? 1080 : 0
var offset = this.h > 690 ? (this.h - 690) : 0
console.log(this.h - (offset + 5))
var conf = {
x: this.w/2,
y: (this.h - 5) - offset,
Expand Down
7 changes: 5 additions & 2 deletions fx/fountain/fountain.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ class Fountain extends Phaser.Scene {

create() {
this.particles = this.add.particles('fountain1');
var offset = this.h > 690 ? (this.h - 690) : 0

for (var i=0;i<4;i++) {
this.particles.createEmitter({
frame: [ 'red', 'yellow', 'white', 'blue', 'green' ],
x: this.w/2,// - (i * 10),
y: this.h - 5,
lifespan: 2000,
angle: { min: 260, max: 280 },
speed: { min: 800, max: 1100 },
speed: { min: 800 + (offset/2), max: 1100 + (offset/2)},
scaleX: { start: 0.2, end: 0 },
scaleY: { start: 0.45, end: 0 },
gravityY: 800,
Expand All @@ -34,7 +36,8 @@ class Fountain extends Phaser.Scene {
y: this.h - 5,
lifespan: 2000,
angle: { min: 250, max: 290 },
speed: { min: 600, max: 1100 },
speed: { min: 800 + (offset/2), max: 1100 + (offset/2)},
// speed: { min: 600, max: 1100 },
scaleX: { start: 0.2, end: 0 },
scaleY: { start: 0.45, end: 0 },
gravityY: 750,
Expand Down
10 changes: 7 additions & 3 deletions fx/spray/spray.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ class Spray extends Phaser.Scene {

create() {
this.particles = this.add.particles('spray');
var offset = this.h > 690 ? (this.h - 690) : 0

for (var i=0;i<12;i++) {
setTimeout(() => {
this.particles.createEmitter({
x: this.w/2,// - (i * 10),
y: this.h - 5,
lifespan: 2000,
angle: { min: 200, max: 340 },
speed: { min: 500, max: 600 },
speed: { min: 500+ (offset/2), max: 600+ (offset/2) },
scaleX: { start: 0.55, end: 0 },
scaleY: { start: 0.55, end: 0 },
rotate: { min: -720, max: 720 },
Expand All @@ -37,12 +39,14 @@ class Spray extends Phaser.Scene {
y: this.h - 5,
lifespan: 2000,
angle: { min: 250, max: 290 },
speed: { min: 900, max: 1200 },
speed: { min: 900+ (offset/2), max: 1200+ (offset/2) },
scaleX: { start: 0.15, end: 0 },
scaleY: { start: 0.15, end: 0 },
gravityY: 800,
bounce: 1.6,
bounds: { x: 0, y: 0, w: this.w, h: this.h },
collideLeft: false,
collideRight: false,
// collideTop: true,
// collideBottom: false,
// alpha: 0.95,
Expand All @@ -57,7 +61,7 @@ class Spray extends Phaser.Scene {
y: this.h - 5,
lifespan: 2000,
angle: { min: 210, max: 330 },
speed: { min: 550, max: 700 },
speed: { min: 550+ (offset/2), max: 700+ (offset/2) },
scaleX: { start: 0.15, end: 0 },
scaleY: { start: 0.15, end: 0 },
gravityY: 900,
Expand Down

0 comments on commit e2f2ae9

Please sign in to comment.