Jump to content

galen

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by galen

  1. Ah, that's what anchor is used for, thanks for showing me that as well! Looks much better now
  2. Hi, I did what you suggested, had to look up some math stuff though https://jsfiddle.net/t2pytweb/10/. Do you know how the lines could be always centered in the middle of the circle, so that it looks a bit better? It should only be a matter of adding a few extra pixels on the x and y axis but I'm not sure how to reliably do that.
  3. Hi, nice of you to show your idea I wasn't aware you could save the circles like that, so thanks! Yes, it works as intended in the picture. I used your line saving idea and made the points move and put it into another jsfiddle: https://jsfiddle.net/t2pytweb/. It's very similar to my first code and I'm new to jsfiddle, so I hope you can see/edit it. I will also try to make it change colors somehow, maybe the points can be at war against each other , but probably not today.
  4. Hello, I tried doing it the way you suggested the other day, but I wasnt sure how to keep track of which line belonged to which points. But today I tried creating the points in create, creating debug lines between each of the points close enogh in update, and then finally rendered the lines in render, and here is the result: The colours could be better, and it would be nice to add some "functionallity" to it, like some dots are blue and some green, and the green dots make a green line and then take over a blue dot, to make it green. Do you want to see the code, P4UL?
  5. Hello, I've been trying to create a nice background with many dots flying around which if close enough to another dot then "links" to that dot. Roughly like the picture attached. I have been able to create some dots flying around but I can't get the line stuff to work. I tried with Phaser.Line and then updating it with line.fromSprite(point1,point2,false) but when doing it with multiple lines, I'm not sure how to keep track of all the lines. Does anyone have any ideas of how to do this?
  6. Hi, I did some poking but to no avail. Instead I added a different of object in the Tiled Editor, a Tile Object. These objects do show up on the logging, which is something. My next step would then be to use the tilemap.createFromObjects function which there is a example of on this page, http://phaser.io/examples/v2/tilemaps/create-from-objects#gv. I'm also looking at the phaser documentation to see how to use it, unfortunately, it's also not working, but hopefully soon! I was able to create them! Yay!
  7. Hi, thanks for the response. What I want are the objects in that array. I am able to use phaser tilemap to load my tilemap, but now I also want to have like start and ending points which will change tilemaps depending if the player has gotten to that point or not. However, for some reason map.objects does log the name of my objects layer in Tiled, but not the content of it. This snippet is what I use to load the map. preload... game.load.tilemap('map', 'assets/map2.json', null, Phaser.Tilemap.TILED_JSON); game.load.image('tiles', 'assets/tile-32.png'); create... map = game.add.tilemap('map'); console.log(map.objects); It is obviously not complete, but that should be enough to see the objects, right?
  8. As the title says, I'm currently trying to get objects into my game, however this is not working. When I wrote console.log(map.objects);, I get this Object {ObjectLayer: Array[0]} but my objects array in the json file starts like this "draworder":"topdown", "height":30, "name":"ObjectLayer", "objects":[ { "height":40, "id":2, "name":"hej", so there is obviously something there. Any ideas? And yes I am sure I'm using the same json file.
×
×
  • Create New...