Jump to content

Search the Community

Showing results for tags 'classes'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 15 results

  1. How about Internet users? I am new to the forum and I have a very small javascript tour, perhaps my problem was that as soon as I entered javascript a friend was teaching me React. Sorry for my bad English, I'm Spanish-speaking. I suppose that many have already touched on this topic but I want you to clarify my doubt that if you can or not, to start with phaser I have more or less a week I did a lot of practices and everything was fine, but when I decided to create a platform project myself Example they have in phaser but in es6 and typescript I wanted to implement the philosophy of
  2. Hey All, I'm using WebPack to build my game and I've run into a scoping issue. I'll try and explain. Below is my TestScene scene/class. import 'phaser'; import Npcs from 'modules/Npcs.js'; const npcs = new Npcs() export class TestScene extends Phaser.Scene { constructor () { super('TestScene') } preload(){...} create(){ this.physics.add.collider( this.player, this.bombs, npcs.hitBomb, null, this ) } } Below is my npcs class import 'phaser'; const gameplayStates = new GameplayStates() export default class Npcs {
  3. Hi, I'm working on creating interactive buttons which, when clicked, will set the colour of the player. I've managed to do this successfully, in Phaser 3, but the code is quite bulky and ugly looking. I've just been gathering what examples I can through the website, but I'm certain there must be a better way to do this. Here's what I've got: I think what I want to do is create a class for "smalltiles", but I'm not sure how the inheritance should work for using alongside Phaser 3. I've tried writing something like in several different way
  4. In the Phaser 3 examples we have an example extending Phaser.Scene like so (http://labs.phaser.io/edit.html?src=src\scenes\scene from class.js): var MyScene = new Phaser.Class({ Extends: Phaser.Scene, // [...] using ES6 we might say instead: class MyScene extends Phaser.Scene { From what I see, I think that these are functionally very similar. But I could easily have missed or misunderstood something. Are these the same in effect (or almost the same)? If there are differences, what are the significant differences? Is one preferred over the other (assuming ES6 is a
  5. Just finding my feet directly in Phaser3 (no Phaser2 exp) [and indeed this forum! Hello there!] The sprites created with this.load.image('sky', 'assets/skies/space3.png'); does the name need to be unique to 'game' or to the 'scene' or not at all? (which i imagine causes problems or is there also a 'spriteID' system too?)
  6. So I went through the basic platformer tutorial and one thing I don't like is that everything is thrown into the create an update methods. I'd like to clean that up a bit by breaking the player into it's own class: /** * Created by Robert on 1/4/18. */ /** * Create the game and define the size of the window. * * Phase.AUTO will use WebGL if the browser supports it * otherwise uses HTML5 canvas. * * @type {Phaser.Game} */ var game = new Phaser.Game(800, 600, Phaser.AUTO); /** * Create the game state. * * Preload: Where you load assets. * * Create: Called once at start. *
  7. Hi, I was able to make scenes using vanilla javascript and BabylonJS. Now I want to refactor all in Typescript as my background is with C#. Anyone has an example how to import a class from another file including what loader do you use, I'm getting this error on the web browser: Uncaught ReferenceError: define is not defined at game.js This are extract of the files: index.html <!DOCTYPE html> <head> <script src="js/babylon.3.0.js"></script> <script src="js/hand-1.3.7.js"></script>
  8. Hi there! I'm new around here, and I'm quite new to JS and especially Phaser. I did a little bit of AS3 a few years back but I'm still pretty rusty, so right now I'm not really able to pull off what I have in mind. I hope you guys can help me out a bit! So, first things first, I am using a multi-state, multi-file-structure to keep it clean. I have succeeded in writing two classes which both have their own file, expanding Sprite and Group. This here is the constructor for the Class that uses Group, nothing fancy. Board = function (game) { Phaser.Group.call(this, game); }; B
  9. Hello. I'm new to Phaser and kind of new to javascript so please bear with me: I'm using this Es6 Phaser boilerplate and in there, there's a Phaser.Sprite extension called Mushroom: import Phaser from 'phaser' export default class extends Phaser.Sprite { constructor ({ game, x, y, asset }) { super(game, x, y, asset) this.game = game this.anchor.setTo(0.5) } update () { this.angle += 1 } } So I tried to replicate this in the Phaser.Text Class like this: import Phaser from 'p
  10. Hey people; I have been developing a framework. I want to publish it as an npm package. I bundle my code with webpack on framework project and I am using bundled js file inside the game project which is bundled via browserify. I wanted to test it with different bundlers. My case is; On framework; the folder hieararchy is; -src --index.js -release --index.js Webpack bundles ./src/index.js to ./release/indes.js in ./src/index.js I have simplest code snippet as follows; module.exports = 'tattaratatta'; on game project that I use framework, I hav
  11. Hi there, i was searching the forum for a method to send information trough the states, and found this post that was very helpfull. http://www.html5gamedevs.com/topic/14708-controls-through-multiple-levels/?hl=%2Bobject+%2Bjson#entry84031 My question is.... Is there a way to create an object in another .js file and use it instead of passing the information with the function state.start? Thank you for your time, and sorry if i didn't explained myself well...English isn't my native language.
  12. Hi, Is anyone attending the Developer Week Conference in San Fran next month? I've never attended this specific conference, and wanted to hear from anyone who has and/or will be attending this year. Any feedback would be great as I would like to know the perceived value of attending from those familiar with this - as I cannot tell from the schedule if this is a focused conference with any valuable classes for the BabylonJS community and other JavaScript tools such as node.js and WebSockets. Are any of you brains building the BabylonJS framework holding any workshops? Perhaps attending at
  13. Heya, Phaser newbie here. I've been playing around making Screens (aka states) and Buttons using this method here. But I seem to have hit a wall trying to put together a basic level. I created a simple floor and a basic object, but they keep ignoring each other. Individually they seem to behave fine. Also I feel the need to point out that I don't know if I'm creating classes the right way (every tutorial I've come across seems to have their own way of doing this, so it ends up being a little confusing for me). Any help would be appreciated. Level1 code: ForestGame.Level1_state = function
  14. Hi there! I'm having an issue with trying to figure out best practices with creating multiple sprites on a screen. I've been using this blog post as a reference for how to structure my game into classes: http://toastedware.com/?p=258 and so far it's been great. I like how neat it leaves my code. However, I've been trying to create multiple instances of a class and whenever a new instance appears, the previous one loses all of its properties and just drops into the ether. Any advice on how to move forward? I've tried creating a group, but I'm not sure how to pass the class into it. For
  15. When using Flixel I would have a gamestate, a player, enemy, perhaps coins etc as separate classes. Maybe a registry that stored assets etc. I had been tooling around with ImpactJS and that framework uses a similar structure. How do I implement a structure like this with a Phaser game? I only want the the index.html to set the css etc and load the game.
×
×
  • Create New...