Jump to content

Search the Community

Showing results for tags 'properties'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • 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


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 13 results

  1. this is very hard to explain, but i essentially have a bunch of sprites holding spears, and seek to have their range beyond what the player can hit from the front. i want the hit box of the "spearman" to be smaller than its weapon (ie: sprite.scale.set(.5, 1)), and believe the best way to do this is to add a second child sprite which is smaller than the original sprite as the hittable body. trouble is, the children inherit the parent's properties, which is not wanted. another way is to make the ORIGINAL body smaller and add a larger child sprite as the spear, but this creates problems with hor
  2. Hi, It seems that the latest Tiled program uses a different tiles "properties" syntax. Different from Phaser 3 expects. Currently if I export a JSON tilemap from Tiled (version 2018.06.01) I get the following tiles descriptions: "tilesets":[ { "columns":8, "firstgid":1, "image":"warTileset_64x64.png", "imageheight":512, "imagewidth":512, "margin":0, "name":"warTileset_64x64", "spacing":0, "tilecount":64, "tileheight":64, "tiles":[ { "id":2,
  3. I want to draw a texture on the line that user draws on the screen. Like a mouse trail, so I follow this tutorial. . The only thing that doesn't answer me is sending the custom uv to the shaders. I vaguely remember that in C++, I can create struct or something and the shader will know how to handle it. It seems that is not the case here. I can't even figure out how does "index" property in vertex shader gets there. Even so, I can't use the "index" approach as the line won't be full rectangle as in the example. Right now, I copied & pasted the entire lines2d classes and try to customiz
  4. I am developing a game using phaser. I wanted to add a feature where user will get alert before any obstacle comes. I am planning to assign a property, "jump": true, to a tile or an object. Is there any way to read this property of the tile that user is passing by. I am following this tutorial for game development - https://software.intel.com/en-us/html5/hub/blogs/how-to-make-a-sidescroller-game-with-html5/. Is there any other better way to achieve this? Your suggestions/ code snippets will be helpful. Thanks
  5. Hello, I ask this with some caution, obviously, since Mesh instances are fairly rich with "property" content as it stands. I'd like to add a couple of custom properties to help some client application code determine whether a mesh is "selectable" or not. I wonder how to go about doing this and keep a sane boundary between the rich existing properties and the application properties. First if it's even possible, in the face of operations like "clone", etc. As a strategy, for instance, I see naming conventions such as "CamelCase" or "camelCase", with or without leading "_under
  6. Hello everyone, I have this doubt (little introduction before): I think is really helpful to use a sprite property to "store" another sprite. For example, when I have several enemies and I want all of them to have a health bar I can do something like this: var enemies = game.add.group(); for(var i = 0; i < 5; i++){ var enemy = game.add.sprite(0, 0, "enemy", 0); var health = game.add.sprite(enemy.x, enemy.y, "bar", 0); enemy.health = health; enemies.add(enemy); } By doing this, I can easily locate the health bar in the game later. For example if I want to chan
  7. I have a portion of my GUI created using the CastorGui extension. I've been trying to pass an object property from the colorSelector.getColor(); (r,g,b) values to another script (my main BJS script), as I have to keep the extension calls and functions in a seperate script. As a quick fix, I also tried to pass a global variable holding the parseFloat() (r.g.b) values, but I haven't had any luck passing these values using either method. What is the best method to pass these values - as well as to pass a CASTORGUI.GUISlider() value to a seperate script to use as a video slider control. I will als
  8. Hello guys, I read http://www.html5gamedevs.com/topic/6495-add-more-custom-properties-to-sprite/ already and understand that in javascript it's free to add any custom property into any object. but i just get started Phaser with TypeScript because of I have experience in strong-type language like C#. I use its type-strict and don't want to use "any" type in order to use intellisense, that make i cannot add custom property to sprite object. Could you mind to tell me how to solve this problem ?
  9. I got a game class and various enemy classes. e.g. a class BasicGame.Enemy_1 = function(){ this.name = "Enemy_1"; this.hp = 10;};and BasicGame.Enemy_2 = function(){ this.name = "Enemy_2"; this.hp = 330;};in both classes sprite/image properties are also set for a game sprite to be created from these informations now in my game i want to collision detect my player and instances of the above enemies (1-n) for this i think i need a "group" of enemies, which can be achieved with this.enemies = game.add.group();so that i don't have to check each enemy instance collision on it's own. afterwa
  10. according to the source: http://docs.phaser.io/World.js.html#sunlight-1-line-1461 convertCollisionObjects gets the properties // properties: json.layers[i].objects[v].properties,but does not do anything with it.. createBody would accept "options" int the 5th field but is using them to create the polygon. http://docs.phaser.io/World.js.html#sunlight-1-line-1378 var result = body.addPolygon(options, data);so this is not the way to go.. (because addPolygon is only taking 3 special options .. so i instead of using this (real game example:) collisionareas = game.physics.p2.convertCol
  11. I'm having a bit of an issue figuring out tile properties in 1.1.5. My understanding is that each tile in a map has an individual set of properties, which can be set in the tile map editor such as Tiled. Here's what I'm doing, screenshots are of Tiled and my game objects being output to the Chrome developer console. I set the properties for each tile in the tileset in Tiled In my game, I can then see the tile properties at the Phaser.TileSet.tileProperties object, which I did not find on the documentation. But the tile properties are not available for each Phaser.Tile object
  12. Hi, I would like to know if it is possible to create more properties for a sprite. For example, I'm creating a multiplayer game that is based on GPS, so I would like to assign a latitude and longitude to a sprite. So I would like to do it like this: sprite.latitude = value; sprite.longitude = value; Is this possible out of the box, or do I have to modify the phaser.js to achieve this? Thanks in advance, Kevin
  13. Hi all, Apologies for what is sure to be a noob question, but I'm trying to switch from Arcade physics to Ninja physics and finding some things that I expected to work properly are not - For instance, I enable a simple AABB physics object by basket = game.add.sprite(game.world.centerX, game.world.height - 100, 'basketimage');game.physics.ninja.enableAABB(basket);..which seems to give the object physics properties and it immediately falls offscreen due to gravity. I try and adjust properties such as basket.body.drag.x = 50;basket.body.maxVelocity.x = 250;basket.body.gravity.y = 0;... to n
  • Create New...