Hot answers tagged

2

I think you can't do it. Phaser groups doesn't have body: http://phaser.io/docs/2.4.4/Phaser.Group But you can use setAll method to set properties to all sprites of a group: http://phaser.io/docs/2.4.4/Phaser.Group.html#setAll Otherwise, if you want more complex objects you could try another type of physics (P2) and make complex bodies with polygons.


1

Rather than loading and unloading the textures on a per-frame basis, one possibility would be to load all the frames for a certain animation at once. For example, if you're about to play the attack animation, load all the frames for the attack animation(s) into memory if they aren't already there (checking whether the animation already exists in memory would ...


1

Microsoft BMP files have a "monochrome" mode which uses just one bit per pixel (the file is still slightly larger due to meta-data). Note that this only applies to the actual graphic files. When you have your graphics framework unpack the image files to textures, the required texture memory might be more than 1bpp.


1

You should have a script attached to your Pen object. Inside this script you have references (wether public or just visible in editor) where you drag the children via editor. class YourPenScript { public GameObject Tint; public GameObject Case; public GameObject Ring; public GameObject Shape; private SpriteRenderer sr_tint; private ...


1

It may seem redundant to have a position component when the Sprite class has x and y properties but this is actually a very valid setup. First, instead of calling it a SpriteComponent lets call it a DisplayComponent instead and implement it as follows: class DisplayComponent implements Component { Sprite display; } The context of the component is now ...


1

Everytime you move the sprite, move the camera too. This sounds like it's essentially what you're doing now. If you're encountering performance issues, then you should profile your code to determine where your slow code is. If you're not seeing performance issues, then you don't need to worry about performance issues. Doing a few calculations every frame to ...


1

Use cast shadows as "Two Sided". You should use a quad with Standard Shader in Cutout and a duplicated and flipped quad for opposite side. They will have mesh rendered in them and auto shadow cast selected. You can turn off Shadow cast for one. That way you are not bound to sprite. You can take advantage of Standard Shader in that case.



Only top voted, non community-wiki answers of a minimum length are eligible