Jump to content

Kacper Pietrzak

  • Content Count

  • Joined

  • Last visited

About Kacper Pietrzak

  • Rank
  • Birthday 07/05/1999

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location
  • Interests
    Running, volleyball, JavaScript and games development :)

Recent Profile Visitors

1351 profile views
  1. @samme Setting in only on sprite works just fine, but I cannot afford generatingTextue from Phaser.Graphics every frame. Setting it only on Phaser.Graphics and not applying it to sprite but just displaying results in white color not giving a nice transparent flashlight shape, but is not visible at all. Making it darker than pure white results in what you see one the left side of the picture. So, this behaviour is still kind of mystery for me.
  2. Hey guys, Recently I've noticed some strange behaviour while using blendModes on Phaser.Graphics. I am creating a flashlight by drawing dark rectangle and lighter calculated shape of light from flashlight, I draw that on Phaser.Graphics object. Then I apply this object as a texture to sprite to see the difference between rendered outcomes. this.shadowTexture = this.player.game.add.graphics( 0, 0 ); this.shadowTexture.blendMode = Phaser.blendModes.MULTIPLY; this.sprite = this.player.game.add.sprite( 200, 0, this.shadowTexture.generateTexture() ); this.sprite.blendMode = Phaser.bl
  3. You can simply create a Phaser.Text object, set its visible property to false and set it to true on game end. There are of course some things to take care of, dependent on your project such as blocking player's input. You can do exactly the same with Phaser.Button that says Try Again. And just in onclick callback of the button reset whole scene.
  4. Question is pretty straightforward, how can I apply multiple masks to one sprite. Let's say I have a sprite and I want it to be displayed only in particular places. In my case I want zombies to be visible only in light, having only flashlight it's pretty easy to implement since there is only one source of light and I can do something like that: this.zombies.setAll('mask', this.flashlightGraphics); But what do I do when I want to apply multiple masks, is there a way to combine graphics objects ? Thanks
  5. @samid737 Thank you, I had to think it through and I managed to achieve desired effect by using this glow filter that you sent me. Here is the code: https://github.com/PiGames/Project-Nostradamus/blob/dynamic-lightning/src/objects/Flashlight.js
  6. I am sorry, but I couldn't get your solution working, even game.js file that you attached doesn't seem to work for me I cannot tell the difference between the gameplay from original file and the one that you've send me. Also there are couple mistakes in code snippets that you've send, could you please send me only Flaslight.js file that works for you ? And again thanks for your time, I really appreciate
  7. The thing is, the way that I'm handling dynamic lighting is creating mask that cuts off the shape of light from flashlight that is precisely calculated, so any effect that makes this light bigger, like glow filter, is useless for now. because it gets cut off, have to think about it
  8. @samid737 Well It doesn't work actually because the sprite that is basically the light is a solid color, so it looks exactly the same blurred but thanks
  9. Hey everyone! I've implemented simple dynamic lightning in my project, but what I'm missing is soft light edges effect. This what it looks like now: https://youtu.be/M-idTMGYvsw I use sprites' masks to achieve that, code looks somewhat like this: updateShowingLayer() { + this.showMaskGraphics.clear(); + this.showMaskGraphics.lineStyle( 2, 0xffffff, 1 ); + this.showMaskGraphics.beginFill( 0x00000000 ); + this.showMaskGraphics.moveTo( this.player.x, this.player.y ); + + for ( let i = 0; i < NUMBER_OF_RAYS; i++ ) { + const rayAngle = mouseAngle - ( LIGHT_
  10. @RubbleGames Thanks for the feedback! The point is that you don't have to read the wiki, most of the players already know some basics like chicken === proteins, and you can learn through playing itself. Wiki is just a place where you can find detailed info, but it is not necessary to play and have fun
  11. Thanks! Donuts in reasonable quantity aren't that bad The game has its problems with carbohydrates, in real life you eat them with almost every meal. But we thought that it's more attractive for a player to tap on a donut or an apple than on potatoes or rice
  12. Hi Everyone, My team - PiGames have recently finished Feed The Bob, a simple game about keeping proper nutrition style. The idea for the game came from a hackathon, which goal was to help solving the problem of civillization diseases. Live version here: pigam.es/Feed-The-Bob/ Game is available for licensing, for more info, contact me: kacpietrzak@gmail.com I'd love to here your feedback about this game! We are still learning how to make great games, so every honest feedback will be very appreciated.
  • Create New...