Search the Community
Showing results for tags 'prefab'.
-
I'm using the Phaser Editor and I created a prefab for my player sprite, but no matter what I do I can't get it to appear in the assets window or in the options to add prefabs to my scene files. I created the Prefab by using File -> New -> Sprite Prefab. I've tried adding the associated script file to the pack.json file, I've tried loading the script in index.html, I've tried shutting down and restarting the editor but I just cant use the prefab. The prefab shows up where it's supposed to in my folder structure, and I can edit the canvas file normally. I just can't add the prefab to any of my Scenes.
- 1 reply
-
- phasereditor
- prefab
-
(and 1 more)
Tagged with:
-
Hi, we are happy to announce a new (preview) release of Phaser Editor! There are a lot this time: The so waited MacOS support! Visual prefabs (sprites and groups). Visual editor support for states and preloader states. Some TypeScript support. Assets refactorings (great for larger projects) New Project wizards with more options (like include demo assets or use TypeScript). Updated Phaser Editor demos with prefabs and multi-levels. Git UI integration. And lot of fixes and enhancements. Many of them requested by Phaser Editor users (that's great, so many thanks!) Read the release notes. Arian
- 1 reply
-
- phaser editor
- prefab
-
(and 7 more)
Tagged with:
-
Each level (8 in total) in my game has a different enemy prefab. I made it work with the following code, but having a huge if else chain doesn't seem very efficient. Any advice for a better way to do this? if (this.currentLevel === 1) { this.blade1 = new TwoBlades.Blade1(this.game, this.game.world.width * Math.random(), 0); this.blade2 = new TwoBlades.Blade1(this.game, this.game.world.width * Math.random(), this.game.world.height); this.enemySpeed = 150; this.enemySpeed2 = 200; } else if (this.currentLevel === 2) { this.blade1 = new TwoBlades.Blade2(this.game, this.game.world.width * Math.random(), 0); this.blade2 = new TwoBlades.Blade2(this.game, this.game.world.width * Math.random(), this.game.world.height); this.enemySpeed = 200; this.enemySpeed2 = 150; } I also did the same thing in another function, changing text and images in the next level description modal after each level else if(this.currentLevel === 4) { this.nextLevelName.text = 'Growth Spurt'; this.nextLevelBlade.loadTexture('blade4'); this.nextLevelBlade2.loadTexture('blade4'); this.nextLevelAbilityName.text = "Grow"; this.nextLevelAbilityImage.loadTexture('ability4'); } else if(this.currentLevel === 5) { this.nextLevelName.text = 'Ludicrous Speed'; this.nextLevelBlade.loadTexture('blade5'); this.nextLevelBlade2.loadTexture('blade5'); this.nextLevelAbilityName.text = "Speed Burst"; this.nextLevelAbilityImage.loadTexture('ability5'); } As a side note, if I have two prefabs that do the exact same thing, but one is slightly different with some extra functions, do they have to be split into two prefabs or is there a way to use a prefab without using all it's functionality?
-
Hi, I'm probably doing something wrong here, but I can't find it for hours now... please help! I'm working with Typescript on a football game. I have a Game state and a ball sprite. I'm trying to create a class for the ball, which extends Phaser.Sprite. I'm getting no errors in the editor, but I get console error. This is the code for the Game state: // reference to typescript files /// <reference path="../lib/phaser.d.ts" /> /// <reference path="../Objects/Ball.ts" /> module Football{ export class Game extends Phaser.State{ ball: Football.Ball; preload(){ this.game.load.spritesheet("ball","Graphics/3d-ball.png", 229, 229, 4, 9, 6); } create(){ this.ball = new Ball(this.game,100, 100); } update(){ } } } And this is the Ball class: /// <reference path="../lib/phaser.d.ts" /> module Football{ export class Ball extends Phaser.Sprite{ constructor (game: Phaser.Game,x:number,y:number){ super(game,x,y,"ballShadow"); } update(){ } } } When running, I get the following error in the console: "Game.ts:17 Uncaught TypeError: Football.Ball is not a constructor". Can someone tell me what's wrong with my code? Thanks!
- 2 replies
-
- typescript
- prefab
-
(and 1 more)
Tagged with:
-
Hi guys, I'm trying to extend the .kill() function in a prefab that extends Phaser.Sprite. I have the following code: Block.prototype.kill = function() { var killTween = this.game.add.tween(this.scale); killTween.to({x:0,y:0}, 200, Phaser.Easing.Linear.None); killTween.onComplete.addOnce(function(){ Object.getPrototypeOf(Block.prototype).kill(this); }, this); killTween.start(); }; This actually seems to work - in that the tween is run and the block is 'killed', but then all hell breaks loose! The physics of the rest of the game start to go a bit nuts. Blocks disappear randomly, collisions occur with nothing... it just generally messes the whole game world up! Can anyone shed any light on this?
-
So my project has grown with a team now. So far we have two sfx/bgm guys and three, including myself, developers. We now need a 3d modeler/animator to really kick things off as well as a prefab designer. Below are what we need as far as the roles. 3D Artist, many slots opened You will need to be able to design 3d models, properly skin them, and animate them. The good thing is we need LOW RES models so things do not have to be perfect and you do not have to be a fabulous designer. We will turn the 3d assets into 2d sprite sheets similar to how the original Diablo and Fallout series. This is an example of what I am looking for while its a little over pixelated you get the idea. We need both characters as well as objects designed so even if you can not do character animations, we still need a lot of assets done which include: structures, furniture, in-game items, and more. Prefab Designer, 2 slots We need a couple people who are good at layout design. Someone who can design prefabricated structures and such that can be placed in the game as buildings and various points of interest. You will design these prefabs with randomization in mind whereas not everything is 100% static in mind. With the prefab, each place will have a layout with spawners that have a spawn chance to spawn an object from a group so each prefab should not be the same as another. You will be responsible for building the prefabs, as well as setting up the groups. We need some help. The game is still early development while there are a lot of factors for the game that is coming together to really push the game forward. We also do have a lot of the team collaboration already set up to work together. I also am not just the Project lead. I am the lead developer for this project. I do not ask for a lot of time spent on this project but rather whatever someone can help with. For more details.... facebook.com/aftereffectthegame
- 4 replies
-
- indie
- 3d modeler
-
(and 4 more)
Tagged with:
-
Hello everyone, I just recently started using Phaser and I am very impressed with it (and PIXI.js too) amazing work everyone! I started rolling my own Prefab style factory which naturally lead me to thinking about automatically nesting prefabs and in general creating layouts and scenes in json files etc. What started out as a couple dozen lines rapidly exploded into a few hundred... Then I saw that a new version of Phaser was released so naturally I upgraded to 2.0.6 and breezed over the what's new and bingo an asset pack loading system spontaneously appears and the mention of scene creation. Is there an open discussion of this topic already of what's planned or a general listing of existing scene/prefab systems for Phaser/PIXI? My code is early and very rough around the edges having been more or less a stream of hey I should add this, that and this lamp (joke), however it already has a few things that I have found useful and have relied on in the past with other engines and I thought I would share what I have so far and embarrass myself publicly So far my pile of code does the following things that I find useful. 1. Easy way to associate a class with a name and .json file. 2. Simple layouts, nested groups. 3. The ability to reference other .json files to pull common settings from. (sort of inheritance for but data, very rudimentary) 4. Reasonably simple randomness, logging and auditing of data. Anyway if you are interested in discussing or seeing some code have a peek at https://gist.github.com/lardratboy/aa0f25e6741929b1b33f Regards,Brad