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,361 results

  1. Hello everyone. I have built a game using Phaser. On game over, the players high score is recorded in a variable (this.inputScore). To submit their high score to the server, the player clicks a button that takes them to an Index.html page where there is a form they fill in. To avoid cheating, I want the high score variable to be passed from the game's JavaScript file (Game.js) to an input value on the form as a read only value. I have created a function (assignValue) inside the Game.js file to execute this task, but because of it's scope I cannot get the function to be read by the Index.html file. When I place the function at the top of the Game.js script (globally) the Index.html reads the function and executes it accordingly (but with a hard-coded value for testing purposes.) How can I get the Index.html file to read my assignValue() function and pass this.inputScore to the input value in Index.html? Any help would be greatly appreciated - still learning. Thanks. Game.js file: //INDEX.HTML READS THE assignValue function BELOW (WITH A HARD CODED VALUE FOR TESTING) AND //APPLIES IT BECAUSE IT IS IN GLOBAL SCOPE. BUT I NEED THE VALUE TO BE A VARIABLE TAKEN FROM THE //assignValue FUNCTION INSIDE THE GAME CODE. SEE GAME CODE BELOW: function assignValue() { document.getElementById("inputScore").value = 127; }; //GAME CODE var CrystalRunner = CrystalRunner || {}; CrystalRunner.GameState = { init: function() { //...code here }, create: function() { //...code here }, update: function() { //..code here //check if the player needs to die if(this.player.top >= this.game.world.height && this.counter === 0 || this.player.left <= 0 && this.counter === 0) { this.gameOver(); } }, gameOver: function(){ this.game.time.events.stop(); this.player.body.enable = false; //..code here this.updateHighscore(); //..code here }, updateHighscore: function(){ this.highScore = +localStorage.getItem('highScore'); if(this.highScore < this.myScore){ this.highScore = this.myScore; this.inputScore = this.highScore; this.congrats = this.game.add.sprite(this.game.world.centerX-193, this.game.world.centerY-20, 'congrats'); this.congrats.inputEnabled = true; this.congrats.fixedToCamera = true; this.submitScoreButton = this.game.add.sprite(this.game.world.centerX-135, this.game.world.centerY+100, 'submitScoreButton'); this.submitScoreButton.inputEnabled = true; this.submitScoreButton.fixedToCamera = true; this.submitScoreButton.events.onInputUp.add(function() { window.location.href = "index1.php"; }, this); } localStorage.setItem('highScore', this.highScore); }, //THE FUNCTION BELOW IS NOT BEING READ BECAUSE OF SCOPE. HOW TO I MAKE INDEX.HTML READ IT? assignValue: function() { document.getElementById("inputScore").value = this.inputScore; }, }; Index.html file: <?php require_once 'dbconnect.php'; ?> <!DOCTYPE html> <html lang="en"> <head> <title>Crystal Candy Game Login</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" href="css/bootstrap.min.css" type="text/css"/> <link href="css/style.css" rel="stylesheet"> <script type='text/javascript' src='js/jquery-2.2.3.min.js'></script> <script> $(window).on('load', function() { $('#status').fadeOut(); $('#preloader').delay(350).fadeOut('slow'); $('body').delay(350).css({'overflow':'visible'}); }) </script> </head> <body onload="assignValue()" class="bg"> <div id="preloader"> <div id="status">&nbsp;</div> </div> <div class="wrapper"> <div class="texte"> <header> <h1>SUBMIT YOUR SCORE</h1> <img id="logo" src="assets/images/logo.png"> </header> <p>Submit your highscore and you could stand a chance to win a prize!</p> </div> <div id="main"> <form id="form-style" method="post" action="crystalhandle.php" autocomplete="off"> <div class="form-group"> <label class="header-text"><span>First Name</span></label> <input class="form-control" type="text" id="name" name="username" placeholder="Name" title="Please enter your Firstname" required=""> </div> <div class="form-group"> <label class="header-text"><span>Surname</span></label> <input class="form-control" type="text" id="name" name="surname" placeholder="Surname" title="Please enter your Lastname" required=""> </div> <div class="form-group"> <label class="header-text"><span>Email</span></label> <input class="form-control" type="email" id="email" name="email" placeholder="Mail@example.com" title="Please enter a Valid Email Address" required=""> </div> <div class="form-group"> <label class="header-text"><span>Phone</span></label> <input class="form-control" type="tel" id="name" name="phone" placeholder="Phone" title="Please enter your Phone No" required=""> </div> <div class="form-group"> <label class="header-text"><span>Score</span></label> <input class="form-control" type="tel" id="inputScore" name="score" value="" readonly> </div> <!-- I need the above input value to have the variable from assignValue inserted into it--> <div class="w3ls-btn form-group"> <div class="wthreesubmitaits"> <input type="submit" name="signup" id="reg" class="button" id="next1" value="Send" style="font-family: sans-serif; font-size: 17px; font-weight: bold;" </div> </div> </form> </div> </div> <script type="text/javascript" src="js/phaser.min.js"></script> <!--the below js file is where assignValue() is defined:--> <script type="text/javascript" src="js/states/Game.js"/></script> </body> </html>
  2. Hey Guys I have a few eCards created in Phaser. Chrome 66 update has messed up the music and I need these fixed urgently for Christmas. Please help! Check some of the cards out here: https://ekarda.com/corporate-christmas-ecard/ https://ekarda.com/ekarda-gallery/corporate-holiday-ecards/ I think we have around 10 that need fixing. Please contact me initially via: https://ekarda.com/contact with pricing and suggested turn around time. I need this started immediately and completed QUICKLY as we supply cards for Christmas
  3. MC_CatMaster

    Collisions not detecting with Phaser

    I've started using the Coding with Chrome extension to code Phaser on my Chromebook. I've added gravity and I'm trying to detect when things collide using physics.arcade.overlap(), but the function I provide for when it collides is never called. What I do is I make a matrix of objects and then detect collisions between each of them and the player. I think there's a better way to do this with groups but I'll look into that later. Here's my code: var player, map, mapObjs; map = [['b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b'], ['b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b'], ['b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b'], ['b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b'], ['b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b'], ['b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b'], ['b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b'], ['b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b']]; mapObjs = new Array(map[0].length); var game = new Phaser.Game(768, 768, Phaser.AUTO, 'Unnamed Game'); game.state.add('main', { preload: function(e) { game.load.image('background', '{{ file:background.png }}'); game.load.image('player', '{{ file:download.jpeg }}'); game.load.image('block', '{{ file:Brick_Block.png }}'); }, create: function(e) { if (navigator.userAgent == 'CwC sandbox') {game.time.desiredFps = 30;} var backgroundImage = game.add.image(0, 0, 'background'); backgroundImage.width = 768; backgroundImage.height = 768; player = game.add.sprite(50, 100, 'player'); game.physics.startSystem(Phaser.Physics.ARCADE); game.physics.arcade.enable(player); player.body.gravity.y = 9; player.body.bounce.y = 0.1; player.width = 100; player.height = 100; player.body.collideWorldBounds = true; for(var i = 0; i < map[0].length; i++) { mapObjs[i] = []; for(var j = 0; j < map.length; j++) { mapObjs[i][j] = game.add.sprite(32*i, 300+32*j, 'block'); mapObjs[i][j].width = 32; mapObjs[i][j].height = 32; } } }, input_: function(e) { }, update: function(e) { this.input_(e); for(var i = 0; i < mapObjs.length; i++) { for(var j = 0; j < mapObjs[i].length; j++) { game.physics.arcade.overlap(player, mapObjs[i][j], function(object1, object2) { console.log('hi'); // This never happens for some reason even thought the objects are visibly overlapping player.body.gravity.y = 0; player.body.accelerationY = 20; }, null, this); } } }, render: function(e) { }, }, true); game.state.start('main'); The '{{ file:background.png }}' is just the way that the editor references images so you can ignore it.
  4. Walk without stepping on the line! The time limit is randomly from 15 seconds to one minute. Extend the record as long as possible.Once the walking distance per meter the earth will be saved (it is supposed to be). Even if the earth is safely saved, you will not get items or proceed to the next level. Even so, you should be happy that the earth was saved anyway.If you step on the line the distance is invalid and it will not be recorded. And the Earth will be destroyed once (it is supposed to be!). https://motquu.itch.io/earth-will-be-saved
  5. quiphop

    [WIP] Bumgineer Demo

    Heya everyone! I've just released my game (demo/beta) It's a sci-fi clicker/rpg/point-and-click adventure about the scientist in a parallel dimension It's available on play Market https://play.google.com/store/apps/details?id=com.quiphop.bumgineer Also You can play it in the browser (mobile-friendly) https://quiphop.itch.io/bumgineer It's absolutely free (screw ads!) I'll appreciate any feedback Enjoy! ps: the game made with Phaser. Thank You Rich for ability to create own worlds
  6. Pilokio

    Phaser 2 Level switching

    Hi all, I have made a game where once the player reaches the end of it a new level should start but I'm not sure how to do this? I have set up multiple states such as a boot, load, game, main menu and the actual game. Is it possible to set up a state so that will switch to level 2 once the goal is reached? Here is my code for reference, any help is appreciated : (the win state takes the player to a menu that congratulates them, this is where I want the player to press a key and the next level can be loaded) //this game will have only 1 state var music; var score = 0; var scoreString = ''; var scoreText; var playState = { //initiate game settings init: function () { //adapt to screen size, fit all the game this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; this.scale.pageAlignHorizontally = true; this.scale.pageAlignVertically = true; this.game.physics.startSystem(Phaser.Physics.ARCADE); this.game.physics.arcade.gravity.y = 1000; this.cursors = this.game.input.keyboard.createCursorKeys(); this.game.world.setBounds(0, 0, 360, 700); this.RUNNING_SPEED = 180; this.JUMPING_SPEED = 550; }, //executed after everything is loaded create: function () { this.sfx ={ jump : this.add.audio('jump'), coin: this.game.add.audio('coin') }; music = game.add.audio('lvl1'); music.play(); //Score scoreString = 'Score : '; scoreText = game.add.text(175, 55, scoreString + score, { font: '34px Arial', fill: '#fff' }); scoreText.fixedToCamera = true; this.ground = this.add.sprite(0, 638, 'ground'); this.game.physics.arcade.enable(this.ground); this.ground.body.allowGravity = false; this.ground.body.immovable = true; //Parse the file this.levelData = JSON.parse(this.game.cache.getText('level1')); this.platforms = this.add.group(); this.platforms.enableBody = true; this.levelData.platformData.forEach(function (element) { this.platforms.create(element.x, element.y, 'platform') }, this); this.platforms.setAll('body.immovable', true); this.platforms.setAll('body.allowGravity', false); //fires this.fires = this.add.group(); this.fires.enableBody = true; var fire; this.levelData.fireData.forEach(function (element) { fire = this.fires.create(element.x, element.y, 'fire'); fire.animations.add('fire', [0, 1], 4, true); fire.play('fire'); }, this); this.fires.setAll('body.allowGravity', false); //coins this.coins = this.add.group(); this.coins.enableBody = true; var coin; this.levelData.coinData.forEach(function (element) { coin = this.coins.create(element.x, element.y, 'coin'); coin.animations.add('coin', [0, 1, 2, 3], 8, true); coin.play('coin'); }, this); this.coins.setAll('body.allowGravity', false); //goal this.goal = this.add.sprite(this.levelData.goal.x, this.levelData.goal.y, 'goal'); this.game.physics.arcade.enable(this.goal); this.goal.body.allowGravity = false; //create player this.player = this.add.sprite(10, 545, 'player', 3); this.player.anchor.setTo(0.5); this.player.animations.add('walking', [0, 1, 2, 1], 6, true); this.game.physics.arcade.enable(this.player); this.player.body.collideWorldBounds = true; this.game.camera.follow(this.player); this.barrels = this.add.group(); this.barrels.enableBody = true; this.createBarrel(); this.barrelCreator = this.game.time.events.loop(Phaser.Timer.SECOND * this.levelData.barrelFrequency, this.createBarrel, this); }, update: function () { scoreText.bringToTop(); this.game.physics.arcade.collide(this.player, this.ground); this.game.physics.arcade.collide(this.player, this.platforms); this.game.physics.arcade.collide(this.barrels, this.ground); this.game.physics.arcade.collide(this.barrels, this.platforms); this.game.physics.arcade.overlap(this.player, this.coins, this.collectCoin,null,this); this.game.physics.arcade.overlap(this.player, this.fires, this.killPlayer); this.game.physics.arcade.overlap(this.player, this.barrels, this.killPlayer); this.game.physics.arcade.overlap(this.player, this.goal, this.win); this.player.body.velocity.x = 0; if (this.cursors.left.isDown) { this.player.body.velocity.x = -this.RUNNING_SPEED; this.player.scale.setTo(1, 1); this.player.play('walking'); } else if (this.cursors.right.isDown) { this.player.body.velocity.x = this.RUNNING_SPEED; this.player.scale.setTo(-1, 1); this.player.play('walking') } else { this.player.animations.stop(); this.player.frame = 3; } if (this.cursors.up.isDown && this.player.body.touching.down) { this.sfx.jump.play(); this.player.body.velocity.y = -this.JUMPING_SPEED; } this.barrels.forEach(function (element) { if (element.x < 10 && element.y > 600) { element.kill(); } }) }, collectCoin:function(player, coin){ // Increase the score score += 20; scoreText.text = scoreString + score; this.sfx.coin.play(); coin.kill(); }, killPlayer: function (player, fire) { score = 0; music.stop(); game.state.start('die'); }, win: function (player, goal) { game.state.start('won'); music.stop(); }, createBarrel: function () { //Give me the first dead sprite var barrel = this.barrels.getFirstExists(false); if (!barrel) { barrel = this.barrels.create(0, 0, 'barrel'); } barrel.body.collideWorldBounds = true; barrel.body.bounce.set(1, 0); barrel.reset(this.levelData.goal.x, this.levelData.goal.y); barrel.body.velocity.x = this.levelData.barrelSpeed; } };
  7. Hello everyone, BlockTanks is a simple and explosive multiplayer tank game. Join other players in a fast-paced and destructive team deathmatch. Collect weapons and defeat the enemy team using strategy, cooperation, or good old-fashioned brute force. Play the game at blocktanks.net Features: Lobby with multiple maps and matches. Power ups like rockets, bombs, and flashbangs. An account system so you can track your stats and level up. Unlockable items such as stickers and decals. Made with Phaser and NodeJS, and hosted on AWS Lightsail.
  8. Hi, I'm new with Phaser, I'm wondering how can I create a group of enemies that appears at the side of the screen in a random Y position between 550px and 745 px, after they appear they need to start to fire to my character Right now I have a function to create the bullets and how they will be fired: createBullets:function(laserToFire,track,offsetX, offsetY, bulletDirection,fireRate,bulletSpeed){ weapon = gameSP.add.weapon(10, laserToFire); weapon.bulletKillType = Phaser.Weapon.KILL_WORLD_BOUNDS; weapon.bulletSpeed = bulletSpeed; weapon.fireRate = fireRate; weapon.trackSprite(track, offsetX, offsetY); weapon.fireAngle = bulletDirection;right } So what I'm looking to do is to have each one of my enemies within the group to fire to my character. Thanks in advance.
  9. https://tibibi.herokuapp.com/ This is a prototype for an HTML5 multiplayer game I'm making. This prototype is actually defunct as I'm now starting up a new game--a 3D multiplayer game, in fact. The data and experienced gained from the development of this prototype will be used for the success of the 3D multiplayer game. Some of the technical aspects: Initially, socket.io was used to establish real-time communication between the client and the server, but the ws WebSocket library was then migrated to. A client-server protocol of binary data is primarily used to share game state between the clients and the server. On the client-side, the Phaser game development framework is used to render the game and perform client-side collision detection. On the server-side, a small and simple custom made game headless game engine made with Node.js is used to manage game state and also distribute the game state to the connected game clients. How to play: To move, use the WASD keys. To shoot, aim with the mouse and press the left mouse button in the direction that you want to shoot in. You can shoot and eliminate other connected players, making them respawn after five seconds.
  10. Game Link: Vocab RPG Vocab RPG is an Online RPG about catching Monsters & collecting Vocabulary Cards! Features: Open world with unique zones to explore MMO: Online multiplayer Monsters: Hunt, battle, and catch many unique monsters! Crafting: Collect different resources and use them to craft items & consumables Language Learning: Unlock vocabulary cards! Currently 4 vocabulary languages to choose from: Chinese, German, Japanese, Russian Overview: In Vocab RPG, you have all the elements of a monster-focused RPG: Hunting, fighting, catching, levelling, crafting, etc. But for every action that you take in the game, it will show you a vocabulary card! As a consequence, the more words you know, the stronger you also become in the game. The game starts very slowly with only 3 words unlocked. But as you progress in the game, you can unlock more cards and expand your vocabulary - at your own pace. Difficulties: To take into account different learning preferences, you can pick your challenge by choosing from 4 difficulty settings: - Normal: Wrong answers reduce your monster's attack or consumables (such as potions) by 25%. - Casual: Even if you answer wrong, you will attack and operate at 100% effectiveness. In other words, you see the cards but there is no consequence for answering wrong. - Hardcore: When you answer wrong, your monster's attack will fail! So answering wrong means 0 damage dealt. - Off: I also want people to enjoy this game, even when they are not really in the mood for studying vocabulary cards right now.... select 'Off' and you will not see any vocabulary cards in the game! Platform: Thanks to the power of Phaser 3, you can play this game on any device in your browser. No installation required. The game is mobile optimized, so whether you play on your laptop or phone / tablet, is only a matter of your preference. Game Link: If you are interested in trying the game, you can jump right into it: Vocab RPG Feedback: Any feedback is much appreciated! We also have a Discord server for the game where players are exchanging ideas, reporting bugs, and giving feedback: Vocab RPG Discord Credits: The game uses a lot of CC0 assets (like the monster sprites in this post) from various artists. I keep a list of all used assets here (which is also accessible from directly inside the game): Credits List
  11. I have made a map in Tiled and I have a already generated a JSON. Whenever I try to load the map in Chrome and it load only a black screen. When I went to inspect the website there are warning like: No data found in the Json tilemap from Tiled matching the tileset name "RunItUpCity" Cannot create tilemap layer, invalid layer ID given: Bottom Layer TilemapParser.ParseTiledJSON - Layer compression is unsupported, skipping layer 'Bottom Layer' Also, I got an Error that read: Uncaught Type Error: cannot read property 'setCollisionProperty' of null Does anyone think that there is a problem with the map or the code? Here is the JavaScript code if anyone needs it. const config = { type: Phaser.AUTO, width: 800, height: 600, parent: "game-container", pixelArt: true, physics: { default: "arcade", arcade: { gravity: { y: 0 } } }, scene: { preload: preload, create: create, update: update } }; const game = new Phaser.Game(config); let cursors; let player; let showDebug = false; function preload() { this.load.image("tiles", "../assets/tilesets/RunItUpCity.png"); this.load.tilemapTiledJSON("map", "../assets/tilemaps/GetawayCity.json"); // An atlas is a way to pack multiple images together into one texture. I'm using it to load all // the player animations (walking left, walking right, etc.) in one image. For more info see: // https://labs.phaser.io/view.html?src=src/animation/texture%20atlas%20animation.js // If you don't use an atlas, you can do the same thing with a spritesheet, see: // https://labs.phaser.io/view.html?src=src/animation/single%20sprite%20sheet.js this.load.atlas("atlas", "../assets/atlas/atlas.png", "../assets/atlas/atlas.json"); } function create() { const map = this.make.tilemap({ key: "map" }); // Parameters are the name you gave the tileset in Tiled and then the key of the tileset image in // Phaser's cache (i.e. the name you used in preload) const tileset = map.addTilesetImage("RunitUpCity", "tiles"); // Parameters: layer name (or index) from Tiled, tileset, x, y const belowLayer = map.createStaticLayer("Bottom Layer", tileset, 0, 0); const worldLayer = map.createStaticLayer("Top Layer", tileset, 0, 0); const aboveLayer = map.createStaticLayer("Collision Layer", tileset, 0, 0); aboveLayer.setCollisionByProperty({ collides: true }); // By default, everything gets depth sorted on the screen in the order we created things. Here, we // want the "Above Player" layer to sit on top of the player, so we explicitly give it a depth. // Higher depths will sit on top of lower depth objects. worldLayer.setDepth(10); // Object layers in Tiled let you embed extra info into a map - like a spawn point or custom // collision shapes. In the tmx file, there's an object layer with a point named "Spawn Point" const spawnPoint = map.findObject("Objects", obj => obj.name === "Spawn Point"); Also, I will attach the JSON code to the post because it is 17000+ of code. GetawayCity.json
  12. I'm trying to add a bubble-pop spritesheet animation to my game. I have added other sprites fine, and when I add the sprite for the bubble, everything is still good. However, when I go to add the animations, I get an error, "Cannot read property 'add' of undefined. How can I animate the bubble? var config = { type: Phaser.AUTO, width: 1366, height: 768, parent: "canvas", scene: { preload: preload, create: create} }; var game = new Phaser.Game(config); function preload () { this.load.image('freeplayBG', 'images/freeplay-BG.png'); this.load.image('shark', 'images/nice-shark.png'); this.load.spritesheet('bubblePop', 'images/bubble_pop_under_water_spritesheet.png', {frameWidth: 394, frameHeight: 511} ); } function create() { //Set background this.add.image(685, 384, 'freeplayBG'); //Set shark and make draggable var shark = this.add.sprite(200, 300, 'shark').setInteractive(); this.input.setDraggable(shark); this.input.dragDistanceThreshold = 16; this.input.on('drag', function (pointer, gameObject, dragX, dragY) { gameObject.x = dragX; gameObject.y = dragY; }); //create the bubble sprite var bubble = this.add.sprite(700, 300, 'bubblePop'); console.log(bubble); //Sprite {_events: Events, _eventsCount: 0, scene: Scene, type: "Sprite", parentContainer: null, …} console.log(bubble.animations); // undefined console.log(this) //Scene {sys: Systems, game: Game, anims: AnimationManager, cache: CacheManager, plugins: PluginManager, …} bubble.animations.add('pop'); //error happens here bubble.animations.play('pop', 10, false, true);
  13. Play Cool Math

    Multiplayer Flags Quiz

    Hi Everyone. I present my new multiplayer game Flags of the World Quiz (https://flagsquiz.games) There are 6 game types in the game: Multiplayer (speed game with other players); Find the flag; Choose a country; Quiz; 8 flags; Training. You can login by Facebook, and restore your score data on any mobile devices or computers Mobile Versions:
  14. Justin_Wang123

    Rogue Fable III

    Hello everyone! I've been working on Rogue Fable III for about 4 months now, preparing to bring it onto Steam through early access where development will then continue. Since I'm very nearly ready to make the transition I've released the game in its current form to the web which you can check out at the link below. As with RFII, the game was made using Phaser. All feedback is welcome and appreciated. https://www.kongregate.com/games/Justin_wang123/rogue-fable-iii
  15. Ananth

    Remove shiftHSL in phaser

    How can i remove or reset shiftHSL if i set to bitmap image
  16. Hello there, I'm working on 2d collision and stumbled across the overlap function. I'm having trouble with something simple. I have an player entity and an npc entity with a physicsGroup set as a collision circle. As the player touches the circle, I want the npc entity to interact in some way. (say, shoots bullets at the player) I can easily listen to any collisions and trigger a boolean to true.. .. but am struggling to find a way to trigger to turn on or off depending on whether the player entity touches the collision circle. For example: Sends a log to console "collided" if player collides. If player doesnt collide, send a log to console "not colliding". Heres my entity code: export const createEntity = (scene) => { entitySprite = scene.add.sprite(487, 249, '') entityPhysicsGroup = scene.physics.add.group({}) entityPhysicsGroup.add(entitySprite) circleShape = scene.add.circle(0, 0, 0, "0xfb00", 0.3) circlePhysicsGroup = scene.physics.add.group({}) circlePhysicsGroup.add(circleShape) circleShape.body.setCircle(128, -128, -128) isTouching = false scene.physics.add.overlap(circleShape, playerSprite, (e) => { isTouching = true }) } I've tried declaring the boolean as false both globally and in the createEntity function. I've also tried this in the updateEntity function that I have. I personally would have thought that a second callback could be used to trigger a function if the player entity stops overlapping with the circle, or just something in general that listens when things are not touching. The boolean method may work but my logic used to implement it might be a little fuzzy. Any thoughts and help would be much appreciated. From a phaser 3 newbie.
  17. How can I use color code to change sprite color without using tint. It have any plugin to change color of sprite using color code. I want to adjust hue,saturation and RGB colors for my sprite.Is it possible with Phaser? - how?
  18. Like the Title says: I would like a game object (one) to become transparent only if another game object (two) is fully covered by the first object (one). What would be the best way about doing this? Thanks!
  19. Ananth

    sprite color

    Hi, How can i use color code to change sprite color without using tint. Thanks,
  20. Ananth

    color wheel

    How to add color wheel in phaser.And how to use it
  21. Ananth

    color.js/change sprite color

    How can i add color.js in my phaser game.And how can i use it.
  22. Hi Everyone, We are making a game to help people learn to type. We used Phaser 2 and this is our first game so feedback from a group like this would be very helpful. It is a sidescroller where you type in words as they appear to move your character. The levels slowly add more keys and longer words to build up your muscle memory. The demo is now live and is located at: https://playwordbirds.com There is also a short trailer and some other information on the site. Here is the direct link for the trailer: https://www.youtube.com/watch?v=93FlRNyFnF4 There is a feedback button that pops up above the game window, or even better post your thoughts here or email us at wordbirds@switchback.studio. If nothing comes to mind just tell us the thing you liked the least and thing you liked the most. If you are up for a little challenge we are giving away free keys for the game if you can beat the demo! Thanks!
  23. Hello! Our team glad to introduce you fresh baked game - Kage: Ninja's Revenge! The game is brand new and was never published before. Main features are: 1. Total cross-platform experience. Every possible resolution is OK! 2. Completely self made everything ! (music, sounds, UI, graphics, code, ideas) Gameplay features: 1. 25+ deisgned levels 2. Every type of enemy and obstacle needs different approach 2. Survival mode 3. 4 exclusive trap style tracks made by our in-house artist You better to check it out by yourself here: http://fluffyfoxgames.com/devninja/ PM me for licensing and rev share offers.
  24. Humais Shahzad

    In or Out game

    Just released my 1st game In or Out, Its an html5 game built using Phaser v2.6.2 game engine , then i used Cordova to port my html5 game to android. you can play game here: Play In or Out
  25. Hey Guys I'm struggling with an error on safari/ios... the first 5 times the state change works. but after the 5th time the error "null is not an object (evaluating 'canvasBuffer.context.scale')" appears. I traced the error back to the graphics.generateTexture(); function. as already said after the fifth state change the error occurs at the third execution of the command (the command is executed 3 times per state). Do you have any idea what it is or how to circumvent it? Thanks