Skip to content

Commit 43b0ecd

Browse files
committed
Removing PIXI integration, keeping compatibility
1 parent fd9f82f commit 43b0ecd

File tree

3 files changed

+75
-173
lines changed

3 files changed

+75
-173
lines changed

demo/app.js

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@ const tex = {
1414
// const emitter = PIXI.Particles.from('assets/star.png', 512);
1515
// emitter.life = 2000;
1616
// Object parameter, specify all of the attributes you want at creation time
17-
const emitter = PIXI.Particles.from({
18-
life: 2000,
19-
maxCount: 512,
20-
src: 'assets/star.png',
21-
});
22-
app.stage.addChild(emitter);
2317

2418
let wreight = 0;
2519

@@ -62,7 +56,7 @@ const subtitleStyle = {
6256
dropShadowBlur: 5,
6357
};
6458

65-
let subtitle = new PIXI.Text('PixiJS + FOSS Game Engine Features', subtitleStyle);
59+
let subtitle = new PIXI.Text('FOSS Game Engine Features for any Stack', subtitleStyle);
6660
subtitle.y = wreight += 32;
6761
subtitle.anchor = {x: 0.5, y: 0};
6862
content.addChild(subtitle);
@@ -88,7 +82,7 @@ txt.anchor = {x: 0.5, y: 0};
8882
content.addChild(txt);
8983

9084
wreight += txt.height + 16;
91-
txt = new PIXI.Text("What's the point in making a game if it's not interactive? ZephyrJS' mouse and keyboard handling uses an extremely efficient backend, benchmarked in both Chromium and Firefox to ensure the best performance no matter the user.\n\nUsage is even easier, just call the PIXI.Mouse and/or PIXI.Keys functions! Due to the way ZephyrJS actually stores input data, you can determine if a key/mouse button is newly pressed with fired(keyOrBtnName), or if it's held down with down(keyOrBtnName)", basicTextStyle);
85+
txt = new PIXI.Text("What's the point in making a game if it's not interactive? ZephyrJS' mouse and keyboard handling uses an extremely efficient backend, benchmarked in both Chromium and Firefox to ensure the best performance no matter the user.\n\nUsage is even easier, just call the ZEPHYR.Mouse and/or ZEPHYR.Keys functions! Due to the way ZephyrJS actually stores input data, you can determine if a key/mouse button is newly pressed with fired(keyOrBtnName), or if it's held down with down(keyOrBtnName)", basicTextStyle);
9286
txt.y = wreight;
9387
txt.anchor = {x: 0.5, y: 0};
9488
content.addChild(txt);
@@ -100,19 +94,19 @@ txt.anchor = {x: 0.5, y: 0};
10094
content.addChild(txt);
10195

10296
wreight += txt.height + 16;
103-
txt = new PIXI.Text("A game without sound effects sounds... like nothing at all? But YOU want sound for your games, so why bother wrestling with having <audio> elements offscreen, or trying to wrangle WebAudio? Well ZephyrJS does the latter for you, using the extremely fast API with a backend to minimize memory usage while providing a dead-simple interface for it!\n\nUse PIXI.Audio.from(src) to get an object back with a customizable attributes like gain and pan, as well as play() and start functions. Zephyr takes care of the audio storing, buffering, and creating WebAudio nodes!", basicTextStyle);
97+
txt = new PIXI.Text("A game without sound effects sounds... like nothing at all? But YOU want sound for your games, so why bother wrestling with having <audio> elements offscreen, or trying to wrangle WebAudio? Well ZephyrJS does the latter for you, using the extremely fast API with a backend to minimize memory usage while providing a dead-simple interface for it!\n\nUse ZEPHYR.Audio.from(src) to get an object back with a customizable attributes like gain and pan, as well as play() and start functions. Zephyr takes care of the audio storing, buffering, and creating WebAudio nodes!", basicTextStyle);
10498
txt.y = wreight;
10599
txt.anchor = {x: 0.5, y: 0};
106100
content.addChild(txt);
107101

108102
wreight += txt.height + (window.innerHeight * 0.15);
109-
txt = new PIXI.Text('Particles', subtitleStyle);
103+
txt = new PIXI.Text('File IO', subtitleStyle);
110104
txt.y = wreight;
111105
txt.anchor = {x: 0.5, y: 0};
112106
content.addChild(txt);
113107

114108
wreight += txt.height + 16;
115-
txt = new PIXI.Text("PixiJS provides a particle container, but it acts just like a faster but more limited container. So why not use ZephyrJS' particle emitters, which take care of all of the hard work and further optimization to provide an extremely customizable particle emitter!\n\nAll it takes to create an emitter is PIXI.Particles.from(options). After that, add it to your scene and call the step() function in the returned object from your ticker loop!", basicTextStyle);
109+
txt = new PIXI.Text("Whether it's level data or player save states, you'll need to handle files input/output. Zephyr adds a super-simple interface for using the native file dialogue system to open and save data in file format.", basicTextStyle);
116110
txt.y = wreight;
117111
txt.anchor = {x: 0.5, y: 0};
118112
content.addChild(txt);
@@ -124,18 +118,9 @@ let time = {
124118
app.ticker.add(function () {
125119
time.elapsedMS = -time.now + (time.now = performance.now());
126120
let applied = {
127-
x: (PIXI.Keys.down('ArrowRight') - PIXI.Keys.down('ArrowLeft')),
128-
y: (PIXI.Keys.down('ArrowDown') - PIXI.Keys.down('ArrowUp'))
129-
}
130-
131-
emitter.fresh = false;
132-
emitter.spawn.x = player.x - emitter.x;
133-
emitter.spawn.y = player.y - emitter.y;
134-
emitter.fresh = applied.x != 0 || applied.y != 0;
135-
if (emitter.fresh) {
136-
emitter.direction = (applied.y != 0 ? Math.PI * 0.5 * -applied.y : (1 + applied.x) * Math.PI * 0.5);
121+
x: (ZEPHYR.Keys.down('ArrowRight') - ZEPHYR.Keys.down('ArrowLeft')),
122+
y: (ZEPHYR.Keys.down('ArrowDown') - ZEPHYR.Keys.down('ArrowUp'))
137123
}
138-
emitter.step(time.elapsedMS);
139124

140125
player.vec.x *= 0.97;
141126
player.vec.y *= 0.97;
@@ -150,9 +135,9 @@ app.ticker.add(function () {
150135
player.scale.x = applied.x;
151136

152137

153-
player.x = PIXI.utils.clamp(player.x, 0, app.view.width);
154-
player.y = PIXI.utils.clamp(player.y, 0, app.view.height);
138+
player.x = Math.clamp(player.x, 0, app.view.width);
139+
player.y = Math.clamp(player.y, 0, app.view.height);
155140

156-
content.x = emitter.x = (app.view.width * 0.5 - player.x) * mvScale + app.view.width * 0.5;
157-
content.y = emitter.y = ((window.innerHeight * 0.25) - player.y) * mvScale;
141+
content.x = (app.view.width * 0.5 - player.x) * mvScale + app.view.width * 0.5;
142+
content.y = ((window.innerHeight * 0.25) - player.y) * mvScale;
158143
});

src/pixi.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25494,4 +25494,3 @@ ${e}`);
2549425494
return exports;
2549525495

2549625496
})({});
25497-
//# sourceMappingURL=pixi.js.map

0 commit comments

Comments
 (0)