Comments (3)
@jkanchelov In the end I have created my own template.
Aside from the changes I mentioned above:
- remove the
rabbit.png
import so that Parcel ignores it and now it is copied along with the entireassets
folder todist
This is the repo: https://github.com/bySabi/pixijs-typescript-template
I have put you in the credits :-)
from pixi-typescript-boilerplate.
Sorry it's my fault for not adding window.onload
to handle the app's lifecycle.
I have taken the liberty of refactoring the code a little to make it clearer. IMHO the current approach with a single Class that contains everything is much more difficult to maintain.
What I have done is:
- Move constants like, GAME_WIDTH, GAME_HEIGHT to
constants.ts
- The creation part of the
renderer
is all boilerplate, it does not change. I've taken it to theget-app.ts
module and it works as a Singleton - And in
index.ts
I have left the part that is customized like the functions of Sprites creation like "rabbit" and "bunny", the loading of images and the management of events.
The "index" module is handled by the window.onload
callback, which is where the app's life cycle is managed.
It seems clearer to me like that, but it's just my opinion. If you don't think it's correct, tell me the errors, please, to correct them.
This is my fork: https://github.com/bySabi/first-pixi
from pixi-typescript-boilerplate.
Sorry for the slow response. For sure your fork is a lot more cleaner what I wanted the boilerplate to have is everything which I consider as important in one place to be easier for someone new to break it down. Not sure if it's right tho
from pixi-typescript-boilerplate.
Related Issues (14)
- add babelify extension
- Not working on Chrome 83 | macOS 10.13.6 HOT 3
- Dependabot couldn't reach npm.egt-interactive.com as it timed out
- The Best Template on the Net HOT 1
- Dependabot couldn't reach npm.egt-interactive.com as it timed out
- Typo HOT 1
- Assets Update HOT 1
- Add test framework
- npm run build creates 2 .js files. HOT 2
- Dependabot couldn't reach npm.egt-interactive.com as it timed out
- how to use fontawesome? HOT 2
- Template performance HOT 2
- Issue with npm run build HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pixi-typescript-boilerplate.