Jump to content

Search the Community

Showing results for tags 'auto'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

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 6 results

  1. Hi there everyone, As someone asked on the phaser slack, here's a guide to get auto completion for Phaser in Atom on Windows. It is powered by Angelo's tern-phaser plugin. Installing tern This first part explains how to get npm, install tern and the tern-phaser plugin. The first thing that you need to ensure is that you have Node.js installed on your computer. You can download it on https://nodejs.org/en/. This will give you access to npm as well, a handy package manager for js libraries and plugins. It allows you to download install all sorts of packages from the command prompt. Once Node.js has finished installing, we have a few commands to call from the command prompt. On windows, you can access the command line need to press the Windows R key combination, type "cmd" and press enter. Then we need to install a few packages. First, there is tern, the JS analyzer that the tern-phaser plugin uses. In the command line tool, type "npm install tern" and press enter. Npm will take care of the install for you, it will just take a moment. We then need the tern-phaser plugin to be installed where the tern package has been put. You can let windows find the folder for you by typing "npm install -g tern-phaser" in the command prompt and pressing enter. The manual route If AND ONLY IF the automatic install of tern-phaser doesn't work, you'll have to go navigate to the tern install folder manually from the command prompt. To change the folder the command prompt is in, you need to type cd (current directory) followed by the path you want to reach. By default, tern should be installed to C:\Users\YourName\node_modules and tern-phaser should go into your global modules folder, into C:\Users\YourName\AppData\Roaming\npm\node_modules. In the command prompt, you then have to enter "cd C:\Users\YourName\AppData\Roaming\npm\node_modules". Note that you can copy the path from windows and paste it in the command prompt using the right mouse button (Ctrl V doesn't work by default). Right click on the command line window to paste text. Once you got to the right folder, just type npm "install tern-phaser" and press enter. Without -g, the command installs the tern-phaser package in the folder you're currently in. Using tern-phaser with Atom Now, you have both tern and tern-phaser installed on your computer. Let's move to setting up atom to work with tern. There is no native integration of tern in atom. However, there is a plugin called atom-ternjs that works like a charm. We can install the package from the command line as well. Either close and reopen the command prompt or navigate back to your root folder with the following command: "cd C:\Users\YourName". Then, to call the Atom Package Manager, you need to use the apm command. Type "apm install atom-ternjs" and press enter. This will add this package to atom for you. To use tern with your project, you just need to have a tern configuration file. Atom-ternjs can create a basic config file for you. In Atom, you first need to have at least one javascript file loaded. Then, go to packages -> Atom ternjs -> Configure project You can set some parameters in the newly opened tab and click on save and restart server. This will create a new .tern-project file in your project folder. We still need to tell it to use the phaser plugin. You just have to add "phaser" in the plugins section. Here's the content of my .tern-project file: { "ecmaVersion": 5, "libs": ["browser"], "plugins": { "phaser": {} } } Save your file, and then go to package -> Atom Ternjs -> Restart server. If you don't get any error, you're good to go! Note that having a phaser.js file next to your .tern-project file can prevent tern-phaser from working - in which case you'll get a series of errors in Atom.
  2. Hey guys, for all Vim users , check out my tutorial on how to use phaser with vim (includes auto-completion) http://redchilligame.com/how_to_use_phaser_with_vim
  3. @Temechon Is there a way (or can we adda way) to show the new Debug Layer in an external window from the debugLayer.show command (and NOT have it first displayed on the side and have to hit the 'external window' button). I would to initially show the debug layer in an external window using some kind of option switch of course What do you all think about that one
  4. var player; var keys; var shootButton; var bullet; function create() { //game.add.sprite(0,0, 'background'); game.physics.startSystem(Phaser.Physics.ARCADE); //creates player player = game.add.sprite(0.45*600,600-50,'galaga'); game.physics.arcade.enable(player); // allows player to fire 2 bullets bullet = game.add.weapon(2,'bullet'); // when bullet leaves the screen, it will be destroyed bullet.bulletKillType = Phaser.Weapon.KILL_WORLD_BOUNDS; // offset rotation bullet.bulletAngleOffset = 90; // prevents ship from auto firing bullet.autofire = false; // The speed at which the bullet is fired bullet.bulletSpeed = 400; //keeps track of how many bullets were shot bullet.shots = 0; // Tell the bullet to track the 'player' Sprite, offset by 16px horizontally, 0 vertically bullet.trackSprite(player, 16, 0); //enabling keyboard use keys = game.input.keyboard.createCursorKeys(); shootButton = game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR); } function update() { // Reset the players velocity (movement) player.body.velocity.x = 0; if (keys.left.isDown) { // Move to the left player.body.velocity.x = -150; } else if (keys.right.isDown) { // Move to the right player.body.velocity.x = 150; } else { //ship is idle } //shooting the bullet if (shootButton.isDown) { bullet.fire(); } } What I'm trying to do is prevent my player variable from autofiring(holding down space button to fire bullets.). I want the player to be able to shoot two bullets at a time, but only when the player presses the fire button rather than holding it. I was under the impression that bullet.autofire = false; would do the trick, but I was wrong. Am I using the autofire variable the wrong way?
  5. How can i do the babylon libary autocompletion for sublime text? ive looked eveywhere on forums but i cant find it. it will really help me when im programming. if not sublime text how can i do it for any text editor? is there is step by step guide? please help
  6. I'm making a game that need to run on web desktop and mobile devices. At first we were using rendering Auto but we noticed that it was slow on ios. It reached 30fps top on iphone 5. We noticed that auto seem to always choose webgl on ios. On android and desktop it worked perfect. Now we switched to rendering canvas and it works at 60fps on the iphone 5 but we noticed some big, sporadic, slowdowns on Android and desktop. What is the best approach for multiplatform games? Do I need to detect the os of the device? How is this done?
×
×
  • Create New...