Ppozniak

Members
  • Content count

    16
  • Joined

  • Last visited

About Ppozniak

  • Rank
    Member
  • Birthday 05/17/1995

Contact Methods

  • Website URL
    https://bluebracket.net
  • Twitter
    ppozniak95

Profile Information

  • Gender
    Male
  • Location
    Poland, Szczecin
  • Interests
    coding, heavy music and coding.

Recent Profile Visitors

465 profile views
  1. Great, I went through this and it will help for sure. Thanks. Is fs.moveSync(path.join(appPath, 'gitignore'), path.join(appPath, '.gitignore')) used because `fs.copySync` ignores files starting with dot?
  2. So guys, I've been studying create-react-app for a while: https://github.com/facebook/create-react-app/blob/next/packages/create-react-app/createReactApp.js And I think it would be good for create-phaser-app to work in the same way. As someone mentioned earlier that's how I could see it: create-phaser-app will not be updated, because it is installed globally, so it will only create new directory and init in it, then install stuff based on user's settings (what lanaguage, and what examples). Every template could've been lying as separate repository which will be normally updated and curated, also I think we could maybe use branches to create different examples for each templates? We could decide what examples should/could be available and then create branches for each repository. Master branches would be the smallest example possible. Or - one single repo and each branch as a langauge (plain js, ts, coffee?) - if so, I'm not sure about different examples. As create-react-app is MIT, and the CLI seems to be a little complicated maybe we could use it as a base? Let me know what do you guys think about it.
  3. Yeah, that's the thing I'm thinking about much - the best way to create multiple "templates" which will also may have different examples inside depending on how big thing you want, but keeping everything as DRY as possible. I was even thinking if examples presets will be necessary, or they could've been different project? But I think it would be useful for showing off Phaser power with real examples which you can jump into and hack them in your way, play around and learn the mechanics of Phaser.
  4. Thanks, much appreciated. I won't hide that I absolutely don't have experience in terms of community work or generators. I just wanted to raise community's awareness that such way would be probably a good. I'll learn a lot if this goes well, otherwise maybe someone will want to take care of this, or this will just fail. Edit: https://github.com/phaser-contrib
  5. Okay guys! https://github.com/ppozniak/create-phaser-app Here's the thing. For now this is a basic setup that will do basically nothing (you gotta start somewhere). I was thinking if it is necessary to use Lerna here to separate templates for each language (TS, JS coffee). If someone has got a bigger experience than me in terms of doing such generators let me know if that's a good solution. In templates folder each language has it's own template where all the "normal" files will live. I also need to add the "cd ${projectPath}` 'npm install' commands to execute at the end of generator wizard. Usage in terminal will be `create-phaser-app ping-pong` if you want to create a project in new `ping-pong` folder (created in your current cwd). Also in future I was thinking about using https://github.com/tj/commander.js to include optional CLI options. For now I think we should move the discussion about this to some other place and start developing this thing. Also I think it's time to find an *almost perfect* folder/project structure. TODO first: - set up almost perfect folder structure, webpack config and small example (for example rotating logo) for plain javascript template - finish up generator with `cd` and npm i after folders and files are copied If you want to test it use 'node ./index.js name-of-project' Sorry for taking so long time but I've got a lot of my head so much to do, so little time. Best regards.
  6. I agree. I was also thinking about create-phaser-app So I think we'll go with that. Although this may be little more complex than typical yo-boilerplate I was thinking about in the beginning. I think today I'll create a repo, separate forum discussion, and this topic will be preserved only as a list of boilerplates. Thanks for feedback everyone.
  7. There is no repo yet. I wanted to see people's opinion on that first. Then we should decide if we're creating new one, how we're naming the whole thing etc.
  8. Great, added your features to the list. I also think that Lean boilerplate is the most popular one at seems like the most solid one. Let's see what others think, thanks for feedback.
  9. Phaser 3 BOILERPLATES | STARTERS Unify, upgrade, use. Last updated: March 6 Table of contents: 1. Intro 2. create-phaser-app 3. List of existing boilerplates 4. What kind of features we need/want 5. What's the point Intro: Hello there everyone! As Phaser 3 came out I immediately started to look after some Boilerplate which would take care of basic stuff and speed up the development. If you don't know what I am talking about, think of create-react-app, but for Phaser. There are a few already, however I think that is one of the things that shouldn't be re-created every time, but I'd rather see one, powerful, generator that is community driven, updated, and has many options. Richard has mentioned that he prefers this to be created by community, and just highlighted on the Phaser website. I am aware that sometimes you need something really different and boilerplate X won't suit your needs, but that's where configuration comes in (for example question at the beginning which physics you want to use). Unless even that can help you - get a different boilerplate/create new one. I want to help and in my opinion boilerplates are great way to unify the community, show out the best practices and speed up the development. Let me know what do you think about it. create-phaser-app: So currently I am developing this generator, which follows the convention of create-X-app. It will be configurable with --options, or by default running a "wizard" where you select basic options. At the start there will be only plain JS and typescript probably, but later on I'm planning to add things like multiple examples (ping-pong, platformer, etc) and many other stuff, but also some --basic flag where you get 0 configuration small project without any webpacks or anything! https://github.com/phaser-contrib/create-phaser-app Here's the repo. Project will be open up for contributions after I prepare the base. Hopefully after everything's prepared community will be able to focus this one and stop creating new ones, unless they really need to. Existing boilerplates list: https://github.com/oliverbenns/phaser-starter - https://github.com/rblopes/generator-phaser-plus - by @rblopes https://github.com/lean/phaser-es6-webpack/tree/phaser3 - (phaser 3 on different branch, i think it's still in development for p3) by @leandro Boilerplates/examples (things that fall in into example category, but still can be a good foundation) https://github.com/nkholski/phaser3-es6-webpack - generic platformer template (mario in this case) and it's based on phaser-es6-webpack by @nkholski I'll keep the list updated, you can give links in the comments too! Features: What should the perfect boilerplate have Recognizable name ES6 transpilation with babel ES6, CoffeeScript or TypeScript Webpack, along with live and hot reload Environment variables Continuous delivery and continuous deployment Images compress JS minify Standard folder structure with basic scenes like preload screen, game Config file for game configuration with all possible options Maybe something that will make sprite bundles ES lint configuration? (not quite sure as many people have different ways of writing code, however maybe just a small base for further configuration?) CLI commands (like create new object) Popular building integrations (Cordova, Cocoon etc) at least on some level Easy way to update Phaser Configurable at the start: Provide bigger example? or just standard template (for example do you want only one example asset, or whole game generated) Physics selection List of some basic useful plugins? That's all coming to my mind for now, leave the comments what would you like to see in a boilerplate! The point?: I know this may be not immediately clear "what the hell this guy want to do with this topic". I think it would be nice if community choose one boilerplate that already is in a good shape and drop all the focus on it. I don't think that this will be better if every person creates a new boilerplate for no good reason and reinvents the wheel. So to summarize: Create a list of boilerplates to have it in one place Let's choose together a boilerplate which community would accept to take care of, becoming a kind of "official" boilerplate (again think of create-react-app that is used by most of the people). (and yes, I am aware that not everybody will want that, but in most cases unified standard is a good thing, I guess?) List of features that this boilerplate would ideally have. I want to hear your feedback about the whole concept, maybe I am dreaming too much. From my side: https://github.com/lean/phaser-es6-webpack/tree/phaser3 seems to be the most popular, however don't think it's phaser 3 ready yet? Haven't looked at it yet. https://github.com/rblopes/generator-phaser-plus is also looking great, I've used it at it seems it has most of the features. What would I like to hear from you guys: Do you like the idea? If yes, would you like to prefer to choose an existing boilerplate or create a new one How would you name it if new one? If new one, clean start or forked from other project? What features would you add to the list Do you know any other generators that should be on the list? So let me know what do you think about it, let the discussion begin. Yey. Best regards.
  10. Phaser 3 JSDoc Generated Typescript Definitions

    Great! That's what I've been looking for, but can you use this without TypeScript in VSCode using IntelliSense?
  11. Holy sheet. It was like my experience... I was creating a game and decided to stop, just to see if it's so easy to push it into real working .apk thing and play it on mobile like real application! Yay! A while of reading through the internet - Cocoon is giving performance, great thing "canvas+" and it's great and it's easy!!!11 Who doesn't like performance and "easy". Looking at the docs... there is almost nothing there? What the ****, do you just need to upload your files and press one button? That's all? Not possible. I've tried doing it with their Cocoon Developer App for Android, the package was 200mb large, but let's give it a try. The app gave me uncompressing error - I've created a topic on their forums https://forums.cocoon.io/t/cocoon-developer-app-uncompressing-error/5765 but no one answered. Not great start. Oh maybe this app is broken, let's compile it in normal way. But it seems I was trying to install .apk without -debug affix and my phone said "Installation not done"... Yesterday I've downloaded Unity one more time, I said yeah let's **** it it will be easier on Unity. However as a front-end developer I am really in love with JS and after spending a couple of hours with Unity I've felt JavaScript is calling me, and Unity is boring. So I said - hey, I am not giving up! Will try with Cordova itself. Couple of hours, installing requirements finally my first test app. Let's run that awesome "cordova build android" - DONE. But what now? I cannot see .apk. Looking at /platform/android and wondering where the heck is my .apk or if it's even there. Instead of searching the directory I've asked google first for some reason. And there it was - /platform/android/build/apk - Sent it to my mobile phone, installed. And that little moment - it works. Feels great. Now reading this I've used -debug.apk from Cocoon (normal compilation) and guess what - Cocoon logo shows and then the black screen. Will probably give Cocoon another try because it seems great, however not sure why it's not working. For now I'll go with Cordova and see how it goes. EDIT: You probably need to use PHASER.CANVAS not AUTO or WEBGL with Cocoon's Canvas+ (obviously). At least that was the issue in my case, yey! Yeah I know no one cares, but this article was so true that I had to share with you, good to know you're not alone with those kind of problems. I guess sometimes it also lies on the documentation side, while it's not good enough or clear enough. Best regards.
  12. @ncil that's because platforms is a group, which has another groups inside (platform). And in documentation you can find (collide method) https://photonstorm.github.io/phaser-ce/Phaser.Physics.Arcade.html#collide: Velocity on blocks makes an illusion of that the only player is moving, but I don't want the player to only stand and jump so he can move around (like he was slowing down or running faster in real life, but he is always running). Could've done with camera, and stage, but can be also done this way. @samme thanks for the tip. Unfortunately it still doesn't work as intended, however it happens much less often and not so "hard". Seems that removing collision from inner blocks has speed up the game significantly. My theory is that some blocks move faster than others and that's why it creates really tiny floor, because when I was debugging that before touching.right and touching.down were true, while player was on side of a wall. I am not sure about your last point Use a single physics body for each platform. What do you mean by that? You cannot apply physics to group, so I'm kinda confused. Or maybe there is a way to create body? So tiles would be tiles, but then I would apply one big "fake" body that would cover all of the blocks? If that's what you meant I am not quite sure how to achieve that. #Edit I've tried making an empty sprite, then apply body to that and make it as long as the tiles, same with height and it's working pretty good! Never thought of making empty sprite, which is kind of silly in terms of logic I guess? However thanks for the help! Best regards. Like this
  13. Thanks for your reply @ncil I have a simple .collide method, nothing else applied at the moment: this.game.physics.arcade.collide(this.player, this.platforms.children); While platforms is another group that has platform instances inside import Platform from './Platform'; export default class Platforms extends Phaser.Group { constructor(game) { super(game); this.game.add.existing(this); this.game.global.spawnPlatform = new Phaser.Signal(); this.game.global.spawnPlatform.add(this._spawnPlatform, this); this._init(); } // Create initial ground _init() { this.add(new Platform(this.game, { width: this.game.width * .5 })); } // Spawns platform _spawnPlatform(prevRight = 0) { const RAND_Y = this.game.rnd.integerInRange(200, 400), GAP = this.game.rnd.integerInRange(0, 200), RAND_WIDTH = this.game.rnd.integerInRange(150, 700); this.add(new Platform(this.game, { startX: prevRight + GAP, startY: this.game.height - RAND_Y, width: RAND_WIDTH, })); } } Just adding this in case this matters. Hope that makes sense. Best regards.
  14. Hello there. I am dealing for a long time with this issue. I am making an endless runner where platforms are made from small chunks (each 32x32 square). Character should fall down, not stop on the wall. This also happens when chunks don't have any velocity, until I add if( this.body.touching.right ) { this.body.velocity.x = 0; this.body.acceleration.x = 0; } to the player sprite. When I don't apply velocity to the chunks but instead say this.left -= 10 on chunk group in update the things are get more weird I guess that has to do something with chunks, am I doing this in wrong way? Each platform is a group, to which I add those chunks export default class Platform extends Phaser.Group { constructor(game, _) { super(game); const defaults = { startX: 0, startY: game.height - 64, width: game.width * .3, tileLevel: 1, tileFrame: 8, }; this.state = { extended: false }; _ = Object.assign({}, defaults, _); this.physicsBodyType = Phaser.Physics.ARCADE; this.enableBody = true; // Y axis for(let y = _.startY; y <= game.height + game.global.tileSize; y += game.global.tileSize) { // X axis _.tileLevel === 1 ? _.tileFrame = 8 : _.tileFrame = 1; for( let x = 0; x < _.width; x += game.global.tileSize ) { this.create(x + _.startX, y, 'tileset', _.tileFrame); } _.tileLevel++; } const BODY_OFFSET = 4; this.forEach((child) => { child.body.immovable = true; child.body.allowGravity = false; child.body.offset.y = BODY_OFFSET; child.body.friction.set(0); child.body.velocity.x = -10; }, this); } update() { // Spawn another platform if ((this.left <= this.game.width) && (!this.state.extended)) { this.state.extended = true; this.game.global.spawnPlatform.dispatch(this.right); } // Destroy when off bounds if(this.right < 0) { this.destroy(); } } } Best regards.