Search the Community

Showing results for tags 'phaser'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • 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 3,314 results

  1. Hello all. I've been trying to create a simple line drawing 'game' using a bitmapData object and the CanvasRenderingContext2d object it contains. I've been successful, but it wouldn't support drawing two seperate line segments, preferring instead to make a line from the endpoint of the last line to the starting place of the new one. I wrote up some new code to try to fix that, (and I am probably missing something very obvious) but it does not work. No error is thrown, but nothing shows up onscreen. update: function() { if(this.game.input.activePointer.isDown && !this.game.scale.incorrectOrientation) { if(!this.hasMoved) { this.ctx.moveTo(this.game.input.activePointer.x,this.game.input.activePointer.y); this.hasMoved=true; } else { this.ctx.lineTo(this.game.input.activePointer.x,this.game.input.activePointer.y); this.ctx.stroke(); } } if(this.game.input.activePointer.justReleased) this.hasMoved=false; }
  2. facetiousfactorial.cs

    How to Remove Rough Edges from Sprites

    I know this is probably well known, but I don't know the name for it and no amount of googling could help me find the answer. (Maybe I wasn't googling hard enough.) How do you remove the rough edges from pictures? I mean, how can I show the part of the picture I want to show and remove the whitespace, having the background overlay it.? I'm not using any spritesheets.
  3. Noaml1

    Cant Load Tile Map In Phaser

    I'm trying to follow the starstruck tutorial in typescript, but for some reason when i add the line this.game.load.tilemap('level1', 'assets/level1.json', null, Phaser.Tilemap.TILED_JSON)my game wont run passed the preload method. The file path is definitely correct - and i know this because the other files in the same folder are loading fine (tested). Chrome is giving me the error: Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:16322/assets/level1.jsonUncaught SyntaxError: Unexpected token < localhost/:1 what could be causing this? 'assets/level1.json' is definitely it's location (look at screen shot below).
  4. Noaml1

    Image Not Displaying in Phaser

    I'm following the rougelike tutorial and for some reason the preloader images arent displaying. I load them in the boot state: preload() {//changed the file names to make it easier to type this.load.image('preloaderBackground', 'assets/progBarBack.png'); this.load.image('preloaderBar', 'assets/progBar.png'); this.game.state.start('Preloader'); }and i try to display them here: module RougeLikeClone { export class Preloader extends Phaser.State{ background: Phaser.Sprite; preloadBar: Phaser.Sprite; create() { this.stage.backgroundColor = "#FF0000"; //just to check this.background = this.add.sprite(this.game.width / 2 - 250, this.game.height / 2 - 70, 'preloaderBackground'); this.preloadBar = this.add.sprite(this.game.width / 2 - 250, this.game.height / 2 - 70, 'preloaderBar'); } }} I get a red background with a greenoutlined black box when this runs. Whats the problem? (see attatched)
  5. carlos21

    Phaser using javascript in VS

    Well the header says it all can i use phaser with javascript in visual studio 13? The reason i ask is because i saw a post about how phaser is no longer supporting typescript in VS and i don't want to waste my time with something that is no longer supported.
  6. Hi there!! How to rotate Physics.Arcade.body? I've tried set the Physics.Arcade.Body.rotation(after set the allowRotation to true) to be equal to te sprite angle, but, nothing happends...
  7. Hi there, A while ago I created a realtime(ish) multiplayer game for a university assignment using Phaser, Node and Web-sockets. I haven't been able to put it anywhere before it was marked, but now that it has been people can take a look This was the first proper game I have made and for some crazy reason I decided to attempt a multiplayer game. I didn't really have a clue how to implement multiplayer so there is probably (definitely) a lot of insane stuff going on in my networking code but it seems to work not too badly. Eventually I will upgrade the networking code to follow more along the lines of this valve article https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking I have previously detailed how my networking works in this post: http://www.html5gamedevs.com/topic/5798-updating-players-positions-using-nodejs-and-socketio-multiplayer/#entry34974 Anyway, the game is essentially a racing game with flappy bird mechanics. Get the the hive first while avoiding the obstacles. The backend is powered by node.js which handles starting the games etc. I also randomly generate a level each game so that the obstacles are in different positions/ move at different speeds/ etc etc each round. There are a few elements of the game that are in there just to fulfil the spec set by my uni, like the little video at the end of the course, and I may remove these if I get time. The game is a little buggy in places I know, but worked well enough to get me very good marks hehe Currently it is running on a single digital ocean server, and to be honest I have no clue how many clients it can handle before things start to go boom, so it might be interesting to find out! I have tested it with around 5 with no problems. How laggy the other players appear seems to depend a lot on your distances from the server which is located in Amsterdam. Here in Brighton UK the lag doesn't seem too bad. I created all the graphics myself, but they were greatly inspired by Chasing Aura. I am pleased with how the game looks, and think that it could benefit from a few more obstacle types along the course. One pretty big issue with this game is that the server is not authoritative, meaning that it relies on the clients to inform it about their positions accurately and truthfully. This in theory means anyone with a little bit of js know how can cheat by modifying the code client side. I'm not really sure of a good way to get around this with this sort of game so if anyone has ideas let me know! Anyway, you can take a look at the game here: http://188.226.161.72 I would love to know what you think, if you have any suggestions on how it could be improved etc. Likewise if you have any questions about how the game works please ask and I will do my best to explain! Bye for now Zef
  8. I have searched a few times on this forum for this issue, but I can't seem to fix it based on the results. I want to set up collision based on a polyline, so I add the info GW.game.load.tilemap('collision', 'assets/ghost-wizard.json', null, Phaser.Tilemap.TILED_JSON);And then: GW.map = GW.game.add.tilemap('collision');GW.layer = GW.map.createLayer('collision');On the createLayer line it is throwing the error, 'collision' is the name of the layer as well as the tilemap. When I inspect the element sent to the createLayer method I notice that the layer property is a completely emptya array. I have not altered the tilted JSON info at all. I am using Phaser version 2.0.5 dev branch. Any tips to help figure this one out. Or let me know if you have if any other info is needed. Thanks
  9. yegorf1

    Exit from CocoonJS

    Actually, this topic not about Phaser. Just want to now how to exit form my cocoonjs app. I tried to close app via function exit() { window.open(window.location, '_self').close();}But it doesn't work. Any ideas?
  10. sparksflyupwards

    change sprite velocity on collision

    I have a set of pins set up on a board and I want the ball to get a specific velocity when it collides with a pin in order to guide it to a predetermined destination. basically every time the ball collides with a member of the pins group I do a check to see if the ball should be falling left or right and then force that velocity on the ball, this is designed to ensure that the ball falls in the correct predetermined slot. at the moment I'm using the phaser overlap function: this.physics.overlap(coins, pins, moveCoin, null, this); where move coin looks like this: function moveCoin(coin, pin){ if(shouldMoveRight(coin)) coin.body.velocity.x=100; else coin.body.velocity.x=-100;} Now my issue is that this function seems to only work some of the time and not others. This is pretty confusing and I do not quite understand why that would be the case. Is there a better way for me to implement this or is there something i'm doing wrong? I've tried using the collide function as well with the same effect. Some help will be massively appreciated!
  11. JLauchlan

    Move sprite to array! Help!

    Hello all, trying to move player to an array value, anyone got any advice on how I can do this? Thanks in advance The player movement is based on a dice roll total for a Snakes and Ladders game. So not trying to move the player at x,96 just want to place the sprite at location 4 if dice total is 4 etc. if(player.moved) { //move player to new pos console.log("The player needs to be moved " + player.moved + " by this many places: " + player.number); player.position += player.number; var location = new Array (100); //first row (Right to Left) location[1] = player.position.x=0,player.position.y=864; location[1] = serverPlayer.position.x=0,serverPlayer.position.y=864; location[2] = player.position.x=96,player.position.y=864; location[2] = serverPlayer.position.x=96,serverPlayer.position.y=864; location[3] = player.position.x=192,player.position.y=864; location[3] = serverPlayer.position.x=192,serverPlayer.position.y=864;
  12. As part of a new series on building simple games with open source code and assets, I built this game - http://gamedolph.in/sample-page/matching-pairs/ . Check it out, comment, like, share, yada yada yada.
  13. 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
  14. Hello! I'm puzzling through how one would use an Entity-Component System with Phaser. Normally, I'd add a Sprite component to an Entity, but Sprites in Phaser are kind of like entities, in that they are more than just a texture. Also, Sprites are added to the Game, which then handles rendering them. Normally an ECS-style System would handle their display, so I'm feeling a bit lost. How do I use an ECS with Phaser? Specifically, I'm trying to use ces.js, but if someone has a better library, let me know! Thanks!
  15. Salvatore

    Rectangle collides with Sprite.Body

    Hi \o I'm trying to collide a rectangle with a sprite.body, and nothing happends! I allready try Phaser.Rectangle.intersects, Phaser.Physics.Arcade.intersets and Phaser.Physics.Arcade.overlap and nothing work! I have to enable something? Thanks!
  16. Hello, I have a IFrame and within the iframe I redirect to the game.html. When I click in the game.html everything freezes. Everything works fine when using a computer (any browser), windows phone or android, but with an iphone or ipad it won't work. Below are the example files to replay the problem... index.html: <html><body> <iframe src="click.html" height="900" width="800"/></body></html>click.html <!DOCTYPE html><html> <body> <a href="Game.html">CLICK HERE</a> </body></html>Game.html <!DOCTYPE html><html> <head> <style> body{overflow:hidden;} #game_div { width: 760px; height: 1100px; margin: auto; } </style> <script type="text/javascript" src="./Game/phaser.min.js"></script> <script type="text/javascript" src="./Game/main.js"></script> </head> <body> <div id="game_div"> </div> </body></html>main.js var game = new Phaser.Game(760, 1100, Phaser.AUTO, 'game_div');var overlay, countdownText;var counter = 0;var main_state = { preload: function() { }, create: function () { //game overlay overlay = game.add.graphics(0, 0); overlay.beginFill(0x00A54F, 0.8); overlay.drawRect(0, 0, game.width, game.height); countdownText = game.add.text((game.width / 2), (game.height / 2), counter, { font: "65px Arial", fill: "#ffffff", align: "center" }); countdownText.anchor.set(0.5,0.5); }, update: function() { countdownText.setText(counter++); }}game.state.add('main', main_state); game.state.start('main'); TNX
  17. Hi guys, it is 27thColt here, back with another game. In my 2nd game, you are a guy on a bike trying to avoid and kill the robots in a fallen city. It is different than my first game and there are some things I was able to achieve which were hard before. http://27thcolt.github.io/Robot-Apocalypse/ Pics for some clicks: Github repository: https://github.com/27thColt/Robot-Apocalypse Now the game might not look updated, so I can add any suggestions you guys have. Also, make sure to report bugs and ask questions.
  18. Defend Your Planet! Defend your Planet from an Alien invasion! Earn points by killing enemy Bosses and destroying meteors! With more points you will get better medals. Controls: Move: LEFT and RIGHT arrow on your keyboard Shoot: UP arrow on your keyboard Play it here: http://svejkgames.com/game/defend-your-planet/ Or on GameJolt: http://gamejolt.com/games/arcade/defend-your-planet/26707/
  19. Bertram

    Facebook - freeze onclick

    Sorry wrong question... Please remove View: http://www.html5gamedevs.com/topic/6483-iframe-redirect-to-game-freezes-game-onclick/
  20. michael-Bell

    World.wrap() Issues

    I'm trying to make a simple running animation in phaser to put in as a dynamic animation in a store for a larger game I'm making. I want to have the player running along an infinite line of tiles, and I have made a mockup to test out how it will work. The mockup creates a line of floor tiles on the bottom of the canvas, and gives them a negative velocity, and when exiting the screen, wraps them to the other side. It seems to be working well, but if it is left running, or your computer hangs, even momentarily, the sprites break up and are no longer touching. You can see the mockup here, see the attached screenshot for what happens. How can I keep the floor even and not broken up?
  21. Hi All I would like to do a simple alpha mask but be able to offset the masked picture so that it is centered in the mask since the picture that is being masked is dynamic and can change positions. Any recommendation ? Thanks Rz
  22. Hi, i'm fairly new to JavaScript and very new to Phaser. I'm coming from developing in Java which has amazing content assist (i get the method names, parameters and if available, the description of the method for every object etc) and im wondering if theres a way to set this up with Phaser? I'm using the Aptana IDE and not having any content assist makes things way more difficult.