Search the Community

Showing results for tags 'tiled'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser
    • Pixi.js
    • Babylon.js
    • Panda.js
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 172 results

  1. I created a Mario map in tiled. Then when i try to put it into phaser it wont load. its giving me this error I've searched the internet and haven't found any solutions to this problem. My javascript file lists as follows: Please help, Thanks EDIT: I fixed this problem but now i have a new one. I'm get this error Anybody know how to solve it? Thanks
  2. MyGameBuilder

    Hello, It has been a while since our last post here! MyGameBuilder was formed through a creative joining between the first versions of MyGameBuilder and MightyEditor. The main purpose of MyGameBuilder is to teach users game development in a collaborative manner, where more experienced developers can help others. If you are completely new to the game development you can: Play games - we have some nice user made games! Play with the actormap engine, which doesn't require any coding experience to make a game. Fork game and alter it to make it your own. Start taking guided lessons to learn programming basics, and even create a Phaser based game on your own, If you get stuck doing any of these things, there is usually somebody online who will be glad to help. After finishing the basic tutorials, there are some game related challenges to start practicing with. Main parts of MyGameBuilder: Graphic Editor - easily create your own pixel art, or import graphics here Actor and ActorMap - are part of the ActorMap engine, which allows you to build game without coding. It's as simple as assigning graphics to an actor, defining the Actor's behavior, and placing Actors on the ActorMaps to interact. Also, if you have used an earlier version of MyGameBuilder, you can import your game into the new version. The Map Editor allows you to build maps for your games. It uses the TileMap format so you can convert your graphics into tiles, and put them on the map.You can also import TileMap in JSON format or load TileMap directly into a Phaser game. The Sound Editor allows users to quickly create sound effects, like a coin pickup or a melee hit. There is also a music editor, which you can use to create background music for your game. Currently you can generate metal or 8 bit music, or import your own mp3 file. With the Code Editor, there is no limit to what you can create. The Code editor has a beginner-friendly code mentor which will show information about keywords used in the programming. Also it has JSdoc support so users can describe functions with JSdoc comments, the code mentor will pick those up and show as help info. Code Editor supports full ES6 JavaScript syntax and will automatically pick-up imported modules and share their info with the code mentor. The latest addition is our Hour of Code project: this is a gaming tutorial used in a worldwide classroom project that has users of any experience level program a dwarf character to complete game goals with basic JavaScript commands. Check it out here: https://v2.mygamebuilder.com/hour-of-code And all of this is completely free! It would be really nice if you could share your game developing experience when you were a beginner: How did you begin? Where did you get all the necessary information to build a game?
  3. Hey guys, I'm using the Tiled map editor and creating it with the code below: //GAME PRELOADER this.load.tilemap('map_testmap', 'assets/phaser_assets/maps/map_testmap.json', null, Phaser.Tilemap.TILED_JSON); this.load.image('grass', 'assets/phaser_assets/tiles/grass.png'); this.load.image('spike', 'assets/phaser_assets/tiles/test_spike.png'); //GAME CREATE create: function() { // this.scale.pageAlignVertically = true; this.world.setBounds(0, 0, 2000, 1400); this.physics.startSystem(Phaser.Physics.ARCADE); this.stage.backgroundColor = '#3A5963' // this.add.sprite(0, 0, 'sky'); var map = this.add.tilemap('map_testmap'); map.addTilesetImage('grass', 'grass'); map.addTilesetImage('spike', 'spike'); map.setCollision([0, 1, 2, 15, 16, 17, 18, 19, 20, 30, 31]) this.layer = map.createLayer('Tile Layer 1'); // this.layer.fixedToCamera = false; // this.layer = map.createLayer('Tile Layer 1', 2000, 1400); // this.layer.anchor.setTo(0.5); // this.layer.position.set(this.world.centerX, this.world.centerY); this.layer.resizeWorld(); However, when I start the game up, my layer looks like this, but my actual layer looks like the image on the right. So my question is, how can I push the layer down on the canvas programmatically? I've tried changing the position, but it seems that the collision doesn't move with the layer's position. Any help would be greatly appreciated!
  4. hey guys, I'm making a puzzle game having some grids/tiles.It have almost 100 levels.If i make that in tiled can i store level data for those 100 levels in one json.If i manually create json leveldata and create levels ,will there be any efficiency problem.Because maximum sprites in a level may be 30 something.Which will be the Best choice? .
  5. I'm currently working on automating the loading process of my tilesets/sprites/Tiled map data into my application and I've run into the following snag: When creating the layers of my map (i.e. invoking myTilemap.createLayer(...)) I cannot see any obvious way of preserving the order of tile layers and object layers as they were in the Tiled JSON. From what I can see in the Phaser docs and in Phaser.js itself, it appears that Phaser parses out the tile and object layers into separate groupings within the Tilemap object: layers[] & objects{} respectively. This is fine, but there's no way I can see to tell where my object layers are supposed to be relative to the tile layers. For instance, I have this in Tiled: Tile layer 1 Object layer 1 Tile layer 2 But in the Tilemap object, I get: layers = [Tile layer 1, Tile layer 2] Objects = {Object layer 1} Without relying on naming convention, I can't tell that object layer 1 is between the two tile layers. Am I missing something or is this just the way it is right now? I've got plans to refactor the Phaser.js code locally to address this, but I wanted to reach out here before getting my hands dirty to see if I am missing the easy solution. Thanks in advance for any pointers!
  6. Hi everyone im currently making a game for my project and i am a newbie to phaser and i really strugling to learn it. Can someone assist me or help me to build my game? i really appreciate it please.
  7. Hi everyone, I just wanted to share a new Phaser Plugin called phaser-tilemap-plus, that extends the tilemap loader and factory to support tile animations defined in the Tiled editor. It also allows you to implement collision detection against the map using polygons and rectangles within an object layer, enabling the use of sloped and curved surfaces. It will eventually also support custom properties and region-based events via the object layer. You can access and build the library from GitHub or install it directly as a Node package via NPM. Please note that it is still a work in progress, with features that are yet to be added and kinks to iron out. Anyhow, let me know what you think!
  8. Destroying coins in collision

    Hi guys! I am newbie to phaser and i would like to ask question and guide me in my project. I am currently developing a game for my project. My game will collect coins and coins that have question to be answered and will be evaluated if the user can play next level. Im using Tiled. And i am having trouble when the collision on the coins it increase the score multiple times before it will gone. Here is my code. Hope you guys help me. getCoin:function(){ map.putTile(-1,layer.getTileX(player.x), layer.getTileY(player.y)); score += 10; scoreText.text = 'Score: ' + score; } It replaces the tile with a tile that didnt exist so i appears to be gone.
  9. I have spent some time finding out how to animate tiles in a tile map loaded from a Tiled map exported to JSON. At first I built a utility class called TileMapAnimator (TMA) to animate some tiles using manual data and eventually I extended the class so that it could load animated tile data directly from the map files. With TMA you define your animations in Tiled and load them directly into your Phaser game! I'm sharing this code in the hope that others may find it useful. If you have invested into loading Tiled maps using the built in functions, I believe you can include animations in your game with very little retrofitting. TMA can animate hundreds of tiles without any notable performance degradation. Some usage restrictions apply: In TMA, each animation uses a fixed frame interval for all the tile frames. Tiled actually allows you to specify different durations per frame. Hence TMA picks the first duration as the frame interval. TMA requires tile animations to be defined on one of the tiles included in the animation. This is because TMA scans the map layer for these tiles and sets up the animated tiles at the designated locations Only one animated tile layer is supported for now. Perhaps I will extend TMA to support animation in multiple layers. How to use TMA Import the TMA class: import TilemapAnimator from "../graphics/TilemapAnimator"; In preload(), load the tile map and associated tile sets using the built-in Phaser map loading functions: this.load.tilemap('TileMap', 'assets/maps/world1/TileMap.json', null, Phaser.Tilemap.TILED_JSON); this.load.image('Ground', 'assets/graphics/world1/Ground.png'); Load the tile map again, but this time as a raw JSON file: this.load.json("TileMapAnimations", 'assets/maps/world1/TileMap.json'); In create(), set up the map and layers as usual: const tilemap = this.add.tilemap('TileMap'); const groundTileset = tilemap.addTilesetImage('Ground', 'Ground'); const groundLayer = tilemap.createLayer('Ground'); Create an instance of TMA, passing the game.time object, the tilemap and the layer containing the animations: const tilemapAnimator = new TilemapAnimator(this.time, tilemap, groundLayer); Load the animation into TMA, by specifying the cache key of the raw JSON object loaded in prefetch() using game.load.json(....) and start the tile animations: tilemapAnimator.addAnimationsFromTilemap("TileMapAnimations"); tilemapAnimator.start(); That's all there is to it! Note: I am no NPM expert, but if anyone is willing to turn this into an NPM package or some other practical library, please get in touch so we set it up! The TMA class file is attached below. TilemapAnimator.js
  10. Tiled Map Not Loading - Beginner Question

    Hi everyone, I'm brand new to game dev, and despite many hours of searching on forums, I'm still stuck - would so appreciate any help or pointers. Here is what I have: <script type="text/javascript"> var game = new Phaser.Game(800, 800, Phaser.AUTO, '', { preload: preload, create: create, update: update }); function preload() { game.load.tilemap('testmap', 'assets/testmap.json', null, Phaser.Tilemap.TILED_JSON); game.load.image('Sky', 'assets/images/Sky.png'); game.load.image('Stars', 'assets/images/city_bg.png') game.load.image('Buildings Back', 'assets/images/city_bg.png') game.load.image('Buildings', 'assets/images/city_bg.png') game.load.image('Collision', 'assets/images/cityobjects.png') game.load.image('Collision2', 'assets/images/cityobjects.png') } var map; var layer; function create() { game.stage.backgroundColor = '#000000'; map = game.add.tilemap(); map.addTilesetImage('Sky', 'Sky'); map.addTilesetImage('city_bg', 'Stars', 20, 20); map.addTilesetImage('city_bg', 'Buildings Back', 20, 20); map.addTilesetImage('city_bg', 'Buildings', 20, 20); map.addTilesetImage('cityobjects', 'Collision', 20, 20); map.addTilesetImage('cityobjects', 'Collision2', 20, 20); layer1 = map.create('level1', 40, 40, 20, 20); layer1.resizeWorld(); } function update() { } </script> </body> </html> Sky, Buildings, Stars, Buildings Back, Collision, and Collision2 are layers in Tiled. The tiles are 20x20 and I made sure the .png files were divisible evenly by 20 (that was a previous error message). Now, I no longer have any error messages, but nothing but a black box shows. I know I must be missing something obvious. Thanks for your help!
  11. Hi there, I wanted to start to create a 2D top down game with Tiled and Phaser3 but I am running into some issues. I created some tile layers (wall, floor tiles) and object layers (e.g. agent) and exported it as JSON. My preload function: this.load.json('map', 'assets/tilemaps/0.json'); // Each 32px of size this.load.image('wall', 'assets/images/game/tiles/wall.png'); this.load.image('floor', 'assets/images/game/tiles/floor.png'); this.load.image('agent', 'assets/images/game/agents/agent_0.png'); My create function: var tileSize = 32; var map = this.cache.json.get('map'); var mapWidth = map.width; var mapHeight = map.height; var wall_layer_data = map.layers[0].data; var walls_tilemap = this.add.staticTilemap(wall_layer_data, 0, 0, tileSize, tileSize, mapWidth, mapHeight, 0, 'wall'); Map json (Created with Tiled Version 1.0.3) : Is basically an array of layers: "layers":[ { "data":[0, 0, 2], // etc "height":17, "name":"walls", "opacity":1, "type":"tilelayer", "visible":true, "width":29, "x":0, "y":0 }, { // Next layer for tiles and object layers } Now my issue is that the wall tiles are drawn everywhere (whole map size and 0 and 2 are basically a wall tile). I saw in the examples that all tiles are now in one layer and not separated ones and that all images are also in one file. Is there a way to have multiple layers and separated image files? Furthermore is there still a way to extend a Sprite and then use it with createFromObjects()? Does that method still exists? My goal is to render a json file I created in Tiled. Some of them are simply static tiles, some of them with collision and some of them have extended functionality and therefore need their own Sprite class. Thank you very much!
  12. Tilemap issue

    Hey guys I'm new to Phaser, I looked on Youtube and phaser examples for answers but didn't find any helpful one. I get this error on the console TypeError: location is undefined[Learn More] phaser.js:97736:25 getIndex http://127.0.0.1:5000/assets/phaser.js:97736:25 getTilesetIndex http://127.0.0.1:5000/assets/phaser.js:97770:16 addTilesetImage http://127.0.0.1:5000/assets/phaser.js:97313:19 create http://127.0.0.1:5000/main.js:36:5 loadComplete http://127.0.0.1:5000/assets/phaser.js:28709:13 finishedLoading http://127.0.0.1:5000/assets/phaser.js:75801:9 processLoadQueue http://127.0.0.1:5000/assets/phaser.js:75756:13 asyncComplete http://127.0.0.1:5000/assets/phaser.js:75828:9 fileComplete http://127.0.0.1:5000/assets/phaser.js:76711:13 loadImageTag/file.data.onload http://127.0.0.1:5000/assets/phaser.js:76098:17 Here is my code: var game = new Phaser.Game(500, 400, Phaser.AUTO, "", { preload: preload, create: create, update: update }); function preload() { game.load.spritesheet( "marioSmall", "assets/images/marioSmall.png", 34, 34, 6, 1 ); game.load.image("ground", "assets/images/ground.png"); game.load.tilemap( "map_01", "assets/tileset_json.json", null, Phaser.Tilemap.TILED_JSON ); game.load.image("tiles", "/assets/items.png"); } var mario; var ground; var map; var layer; function create() { // ground = game.add.sprite(0, 370, "ground"); // game.physics.arcade.enable(ground); // ground.body.immovable = true; // mario = new Mario(100, 100, 2000, 800, 200); map = game.add.tilemap("map_01"); map.addTilesetImage("items", "tiles"); layer = map.createLayer("Tile Layer 1"); } function update() { // game.physics.arcade.collide(ground, mario.sprite); // mario.checkInput(); }
  13. Phaser

    Hey everyone, I have noob questions. I'm creating a platformer game with Phaser, as well as Tiled to create a layered JSON map. So far one of my tile layers is handling all of the inanimate object collisions via this.map.setCollisionBetween(0, 600, true, this.collisionLayer, false) to which I've passed indices to my entire tileset (only using one). Given that I've done this, does the number of tiles I actually create in that layer via Tiled affect performance? Would it be advisable for me to just use setCollision() or setCollisionBetween and pass only the necessary tiles that I plan on passing to that layer? My tileset is about 1/3 tiles I want to use for collision, and they're not totally organized but I can reasonable get that done if necessary. Also, what's better for performance, bigger tilesets or more, smaller tilesets. What would you consider a sweet spot for this in terms of size and number of tilesets? Note that I've already compressed my images etc and not having any performance issues so far, just taking preventative measures. Thanks for any help in advance.
  14. Hi everyone, I'm actually making a simple 2d platformer with arcade physic and I recently implemented a tiled tilemap which contain an "object layer". In this object layer I draw collision zone with the polyline tool. Now I want thoses "collision zones" to be recognized by phaser. Which mean : if the player overlap "object layer"'s content, it will blocked as if it was a wall. I just want to know if this is possible or if I must set collision "on" for my tile layers in which I may put all my walls tiles. Also, If I must use the 2nd solution, if my tile sprite is smaller than my 24x24 tile square (I attached an example), will the hitbox fit the sprite size or the 24x24 square ? Thanks beforehand.
  15. Hi Everyone, I need guidance on how can I approach this problem: Would like to apply a tiled texture to complex polygons. I'm using P2 for the physics and tiled for the level editor. I would like to get something similar to worms where the terrain has a tiled texture, the top has grass and the bottom is darker. These are some examples of what I would like to achieve: I don't care at all about destructible terrain. This is how my level looks now with polygons from tiled: http://puu.sh/wMwsg/28b1609d74.jpg
  16. Hi!, I need some help doing new maps for my game: https://multionline.herokuapp.com/ Check this post to know more about the game: http://www.html5gamedevs.com/topic/29477-multiplayer-game-with-items-levels-monster-and-pvp/ I leave all you need to build the map in the zip file of this post! (you need to use tiled to edit it) If I uses the map your name will appear in the game Map Set.zip Thanks!.
  17. I've been having a look through the phaser tutorials for json tiled maps and I've noticed that it's not clear on how to create a json tiled map that is 'phaser ready'. After creating a tiled map in tiled and following the code examples I've been unable to get passed the following error. Cannot read property '2' of undefined line phaser.js:98679 // find the relevant tileset sid = map.tiles[tile.index][2]; set = map.tilesets[sid]; version: 2.6.2 Is there anything obviously wrong with the code or the exported json tile map? Maybe there is a special way to export maps from tiled? Help would be appreciated. Thanks. game = new Phaser.Game(600, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update }); function preload() { game.load.tilemap('map', 'assets/map.json', null, Phaser.Tilemap.TILED_JSON); game.load.image('tmw_desert_spacing', 'assets/tmw_desert_spacing.png'); } function create() { map = game.add.tilemap('map'); map.addTilesetImage('tmw_desert_spacing'); layer = map.createLayer('Tile Layer 1'); } { "height":14, "layers":[ { "data":[0, 0, 0, 40, 40, 40, 40, 40, 40, 40, 40, 0, 0, 0, 0, 0, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 0, 0, 40, 40, 40, 40, 0, 0, 40, 40, 0, 0, 40, 40, 40, 0, 40, 40, 0, 40, 0, 0, 40, 40, 0, 0, 0, 40, 40, 40, 40, 40, 40, 0, 0, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 0, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 0, 40, 0, 40, 40, 40, 0, 40, 40, 40, 40, 40, 40, 40, 0, 40, 0, 40, 0, 40, 40, 40, 40, 40, 0, 40, 40, 40, 0, 40, 40, 0, 40, 0, 40, 40, 0, 40, 0, 40, 40, 40, 0, 0, 40, 40, 40, 0, 40, 40, 40, 40, 40, 40, 40, 40, 0, 0, 40, 40, 40, 40, 40, 40, 40, 40, 40, 0, 0, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 0, 0, 0, 0, 0, 40, 40, 40, 40, 40, 40, 40, 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 40, 40, 40], "height":14, "name":"Tile Layer 1", "opacity":1, "type":"tilelayer", "visible":true, "width":14, "x":0, "y":0 }], "nextobjectid":1, "orientation":"orthogonal", "renderorder":"right-down", "tiledversion":"1.0.1", "tileheight":32, "tilesets":[ { "firstgid":1, "source": { "columns":8, "image":"tmw_desert_spacing.png", "imageheight":199, "imagewidth":265, "margin":0, "name":"tmw_desert_spacing", "spacing":0, "tilecount":48, "tileheight":32, "tilewidth":32, "type":"tileset" } }], "tilewidth":32, "type":"map", "version":1, "width":14 }
  18. I have a graphics issue that I cannot pinpoint. My sprite appears more blurry at some positions of the map. Does anyone have an idea what this kind of problem can depend on? Both of these pictures shows the sprite when idle on different positions - so no animation is playing - and at the first picture the sprite looks more clear than it does on the second one. I don't know what more information I can give on this that is relevant.
  19. Hi. I'm using tiled to create maps for my game. I want to create polygons in the tile collisions editor so when I place a certain tile, lets say a curve with a fence I always want a collision poly along the fence. Currently my curve is made of 6x6 tiles so I load the curve as a tile map in tiled. The tile collisions editor only allow me to add objects per tile. I want a object on the entire tile map instead so whenever I place a curve I get the collision part too. If I would make my tile map into a single tile the problem is that I have to draw 6x tile columns and rows outside the camera or track pieces will popup when the top left 64 x 64 tile enters the camera. (This is my own drawing function created before I found phaser, will phaser drawing do it different?) So basically I want to treat my tile map as 64 x 64 tiles that my game draw while I want collision objects to be active as soon as part of the tile map is drawn. I would prefer if I don't have to create my collision polys as a separate layer after creating the map. Any tips on how to solve this problem?
  20. help me pls, tilemaps collision

    Hello everyone, I am beginner with phaser, i am French and my english is not very nice. I need your help, i am blocked on a collide function. I want my character to collide with my second layer (tree, montain, statue..). (i use tiled map editor and export in json). my code : function preload: game.load.tilemap('map', 'assets/tilemaps/maps/map.json', null, Phaser.Tilemap.TILED_JSON); game.load.image('tiles', 'assets/tiles/tiles.png'); game.load.spritesheet('perso', 'assets/sprite/spritetest.png', 32, 47); function create : game.physics.startSystem(Phaser.Physics.ARCADE); map = game.add.tilemap('map'); map.addTilesetImage('tiles'); layer = map.createLayer('layer1'); layer2 = map.createLayer('layer2'); layer2.resizeWorld(); map.setCollisionBetween(0,2000); //PLAYER // ajout player et parametre player = game.add.sprite(250, 50, 'perso'); // We need to enable physics on the player game.physics.arcade.enable(player, Phaser.Physics.ARCADE); function update : game.physics.arcade.collide(player, layer2); i show an image for understand my problem. Thx to read my message
  21. tilemap not displaying properly

    So I'm having an issue trying to get a tilemap working properly. I made my tilemap in Tiled. JSON: http://intheexpanse.com/rpg/levels/level4.json Image: http://intheexpanse.com/rpg/images//base_out_atlas.png Code: http://intheexpanse.com/rpg/js/main.js Any ideas what I'm doing wrong? I've used multiple tilemaps from different sources and they all have similar display errors. Thank you.
  22. /** * Takes the collision data defined in the collision editor of Tiled and applies it to * and exisiting tilemap for use with P2 physics bodies. * * Tilemap json data MUST be loaded in the Preload state/function using game.load.json() before this function is called * map must only have ONE tileset * each tile can only have ONE polyline set for it's collision * the polyline MUST be a complete shape (the last point is indentical to the first) * * @param {Phaser.Tilemap} map - this is the map which you want polylines added to * @param {string} key - this is the key for the raw json tilemap data loaded in the preload state * @param {bool} [roundValues=true] - Will round the x,y coordinates for the polylines to nearest integer */ addPolylineCollision: function (map, key, roundValues) { if (roundValues === undefined) { roundValues = true; } // json with the collision data that was omitted by phaser let data = this.game.cache.getJSON(key); //console.log(data); let collisionData = data.tilesets[0].tiles; // array of the collision polygons that will get added to the tilemap var polygons = []; // tiles in the Collision Layer that will help define the polygons let mapData = map.layers[map.getLayer('Collision Layer')].data; for (let row in mapData) { for (let col in mapData[row]) { var wall = collisionData[mapData[row][col].index - 1]; if (wall !== undefined) { for (let i in wall.objectgroup.objects) { let poly = { height: 0, name: "", polyline: [], properties: undefined, type: "", visible: true, width: 0, x: mapData[row][col].x * map.tileWidth, y: mapData[row][col].y * map.tileHeight }; for (let j in wall.objectgroup.objects[i].polyline) { var coords = [wall.objectgroup.objects[i].polyline[j].x, wall.objectgroup.objects[i].polyline[j].y]; if (roundValues) { coords[0] = Math.round(coords[0]); coords[1] = Math.round(coords[1]); } poly.polyline.push(coords); } polygons.push(poly); } } } } console.log(polygons); map.collision['Collision Layer'] = polygons; } I'm writing a function to support Tiled's Collision editor and P2 physics. Everything seems fine but the values for all the polygons I defined get mangled to the same values. I thought it was a scope issue but nothing seems to work: pic: https://gyazo.com/17006a8d49e451a7d7010c77c31a7765 (Links to an external site.)Links to an external site. paste: https://pastebin.com/fv9sJpPc (Links to an external site.)Links to an external site. By the time execution reaches line 57, the console.log call, all the values in the polyline arrays are totally messed up, they're set to values between -1 and 1, and are always set to the same values every time. At every other previous point in this functions lifetime everything works exactly as expected.
  23. Draw a curve with texture

    I started working on a game similar to Curve Fever (https://www.youtube.com/watch?v=ojqBnYcxl0c). I’m new to Phaser and Pixijs, so I need advice on how to render a curve on the field. Right now i have two Graphics objects: head (circle using drawCircle()) with arcade physics enabled (to be able to move it around the map tail - static graphics copying head x and y on update drawing a line (lineTo(head.x, head.y) The problem is as you see in the video the grey curve has a texture background. Assuming i have a repeatable PNG with background, how could i map it within the curve that is being drawn? Other question is should I use BitmapData instead of Graphics? I would prefer a lightweight option that would run on older computers. I would also need to be able to detect collisions, I think it's possible to enable it for Graphics but not sure about bitmap.
  24. TileMap doesn't show correctly

    Hi!, i use tiled for create a map, but when i try show the map in the game, this doesn't show correctly (the map in tiled) And the map in the game: The main file: class Main extends Phaser.State { create() { this.game.physics.startSystem(Phaser.Physics.ARCADE); this.game.add.sprite(0, 0, 'Sky'); this.map = this.game.add.tilemap('Tilemap'); this.map.addTilesetImage('Tiles', 'Tileset'); this.layer = this.map.createLayer('Platforms'); this.layer.resizeWorld(); this.wrap = true; this.cursors = this.game.input.keyboard.createCursorKeys(); } update() { if (this.cursors.left.isDown) { this.game.camera.x -= 8; } else if (this.cursors.right.isDown) { this.game.camera.x += 8; } if (this.cursors.up.isDown) { this.game.camera.y -= 8; } else if (this.cursors.down.isDown) { this.game.camera.y += 8; } } } export default Main; Any idea or solution?(sorry for my bad english)