<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://cdn.jsdelivr.net/npm/phaser@3.15.1/dist/phaser-arcade-physics.min.js"></script> | |
</head> | |
<body> | |
<script> | |
var config = { | |
type: Phaser.AUTO, | |
width: 800, | |
height: 600, | |
physics: { | |
default: 'arcade', | |
arcade: { | |
gravity: { y: 200 } | |
} | |
}, | |
scene: { | |
preload: preload, | |
create: create | |
} | |
}; | |
var game = new Phaser.Game(config); | |
function preload () | |
{ | |
this.load.setBaseURL('http://labs.phaser.io'); | |
this.load.image('sky', 'assets/skies/space3.png'); | |
this.load.image('logo', 'assets/sprites/phaser3-logo.png'); | |
this.load.image('red', 'assets/particles/red.png'); | |
} | |
function create () | |
{ | |
this.add.image(400, 300, 'sky'); | |
var particles = this.add.particles('red'); | |
var emitter = particles.createEmitter({ | |
speed: 100, | |
scale: { start: 1, end: 0 }, | |
blendMode: 'ADD' | |
}); | |
var logo = this.physics.add.image(400, 100, 'logo'); | |
logo.setVelocity(100, 200); | |
logo.setBounce(1, 1); | |
logo.setCollideWorldBounds(true); | |
emitter.startFollow(logo); | |
} | |
</script> | |
</body> | |
</html> |
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
Looks like none of the WebGL modes that are listed here |
This comment has been minimized.
This comment has been minimized.
For anyone else experiencing similar issues with the blend modes, |
This comment has been minimized.
This comment has been minimized.
Seems that when you try to load local images and later on this.load.setBaseURL it seems to append the URL even to previously loaded ones. Description of this function states otherwise (that it adds URL "...from this point on..."). Anyone had such issue? |
This comment has been minimized.
This comment has been minimized.
For those having problems with the ADD blend mode. I downloaded the |
This comment has been minimized.
This comment has been minimized.
Hey, this is a nice example to start off with, but can you update line 29 from:
to
please? The reason is that, at present, if you've served You can see I've done this at https://gist.github.com/bartread/95b06e2d295f7158b6c110e360d89fbc but, of course, gists don't support PRs or I would have created one. I haven't made any other modifications though, so you could simply copy and paste the entire file content from my gist. Thanks! |
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
I think this happened because there were no audio files preloaded or used, so the |
This comment has been minimized.
BlendMode 'ADD', doesn't seem to work in Chrome.