bartk

Members
  • Content Count

    18
  • Joined

  • Last visited

  1. Oh thanks jmp, that's a good idea. It is just for debugging and possible future editing, but it's a slight headache to clear the cache every time. Both of yours' help is much appreciated
  2. That does indeed solve the problem, thanks Would this be solved by calling game.cache.removeText('test') before game.cache.getText('test') every time?
  3. Hey, I've got a weird problem with loading a text into a variable from the cache. Slight background, I started with a txt file called test1.txt which contained the text "This is a test". (Just to try out the functionality) Later I changed the text to a part of lorem ipsum to experiment with longer texts and to improvise pagination in a dialogue bubble. However, the variable kept returning "This is a test". My code: game.load.text('test1', 'txt/test1.txt');...text = game.cache.getText('test1');speech = game.add.text(0, 0, text, { boundsAlignH: "left", fontSize: '12px', fill: 'black', wordWrap: true, wordWrapWidth: 160 });I keep failing to make it recognise that the txt file's contents have changed, anyone know what I'm doing wrong?
  4. Thanks ragnarok, that works for me.
  5. Ok, so I've got this little thing going: people = game.add.group();...npc46 = people.create(1500, 880, 'npc2');...people.forEach(function(character) { character.scale.setTo(0.5, 0.5); character.inputEnabled = true; character.events.onInputDown.add(function () { Dialogue(character); }, this);}, this);...function Dialogue(character){ speechbubble = game.add.sprite(character.x, character.y - 170, 'speechbubble'); speech = game.add.text(character.x + 20, character.y - 150, "Hi, I'm " + character, { boundsAlignH: "left", fontSize: '12px', fill: 'black' });}I'd like the character to say it's own object name (for future purposes). However, the character's name (npc46) won't show up, only "[object Object]". Ok, fair enough, so I tried character.name. No luck. pls halp?
  6. bartk

    Limit car to roads

    Much obliged for all the help
  7. bartk

    Limit car to roads

    By the way, what I'm trying to do isn't to keep the player in the world. That was easily done by world bounds as you said. I'm trying to keep the player limited to the roads, so that he can't drive over the sidewalks or into npcs.
  8. bartk

    Limit car to roads

    That certainly looks a lot easier than what I've been doing so far
  9. bartk

    Limit car to roads

    Interesting, I'll check it out, thanks
  10. bartk

    Limit car to roads

    I'm afraid I don't really know what you mean by Tiled. Basically I've used a 50x150 sprite to build all my horizontal lengths of road, and a 150x50 to build the vertical lengths. One of these lengths may be: roads = game.add.group();...road1 = game.add.tileSprite(0, 400, 150, 800, 'road');roads.add(road1);If there's no other way than to create invisible collision "fences", so be it.
  11. bartk

    Limit car to roads

    I have little to no experience with Phaser, or even with gamedesign, so I've just made a few dozen "road" objects with a sprite that's tiled across them. I realize it's possible to just build blocks all around the roads, but I was hoping there'd be a more painless way Here's an example:
  12. bartk

    Limit car to roads

    Yeah, if I could do something close to that but with an object group, I'd be set.
  13. Good afternoon, I'm trying to make a small driving game, and I want to limit my player's car so that he can't move off of the roads and on the sidewalks. Might anyone know how to best handle it? I'd rather not add lots of invisible "fences" to collide with the car if I can help it. Cheers.
  14. Now that I think about it, do you know of a convenient way to actually find out about such specific functions? I know about Phaser's documents, but actually finding what you need can be pretty tricky, especially if you don't exactly know how to solve problem #whichever.
  15. Michael, you're the man. That did exactly what I was looking for. Figured it'd be a case of knowing the right function