Search the Community

Showing results for tags 'vscode'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser
    • Pixi.js
    • Babylon.js
    • Panda.js
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 3 results

  1. I'm currently trying to get my first Phaser project working, fiddled around a whole day trying to get it all set up but since I'm completely new to writing bigger JS projects with modules, I have no idea how any of this works, even after googling and reading a million guides. I want to write TypeScript in VSCode. So first I installed phaser with npm install phaser --save Then I import Phaser in my app.ts with import Phaser = require("phaser-ce"); Did I pick the right syntax out of the 50 different ones? Whatever, this is the one I chose. So, while im coding I now got code completion and type hints working, but after compiling to JS, I now have multiple problems: First of all, the compiler adds code to my main JS file which tries to access a global module or exports object which obviously doesn't exist. Why? Why does it assume this exists? How can I turn this off? No idea. This is what it pastes righto onto line 2 of the main JS file: Object.defineProperty(exports, "__esModule", { value: true }); And since "exports" doesn't exist unless I hack it into the HTML file, it gives me an error. But now the more important question is... how exactly do I import Phaser? As far as I know you can't really import other JS files into another? (At least not in ES5 as far as I know). (Great, after switching my text color to an illegible light gray, forcing me to manually recolor all the text to black, now the text editor here creates a new paragraph instead of a new line everytime I press enter. Whyyyyyyy...........) In order to get code hints I need to import Phaser in my TypeScript file with the import statement, but if I use anything other than "module": "commonjs" in my tsconfig.json It can't find phaser anymore: // tsconfig.json // ... "compilerOptions": { "module": "commonjs", // ... // game.ts import Phaser = require("phaser-ce"); // WORKS // tsconfig.json // ... "compilerOptions": { "module": "anything other than commonjs", // ... // game.ts import * as Phaser from "phaser-ce"; // Can't use same syntax. Why? I don't know. // TypeScriptCompiler error: // Cannot find module 'phaser-ce' But of course commonjs doesn't work in the browser so... I tried instead to load the typings manually by copying the into /node_modules/@types/phaser and then instead of importing Phaser, instead referencing the typings with: /// <reference types="phaser"/> And including phaser.js in my index.htm But since Phaser itself has a bunch of dependencies that it tries to load with require() which of course doesn't exist and even if it did couldn't work, how am I supposed to do this correctly? It just whines about Pixi not being defined and some other stuff. I read http://phaser.io/tutorials/how-to-use-phaser-with-typescript but it never mentions how Pixi etc is supposed to be included and doesn't say anything about require, export, module errors, it just works apparently, but not for me. Which of the 50 different module systems does Phaser use, how does it export itself? RequireJS? AMD? UMD? ES6? ES2015? I have no idea how many different methods there are and how to tell which one is being used. How do I import it correctly? Do I need to manually add ALL *.js files of phaser into the <head> of my index.htm? This is all waaaaay too confusing....., help please Edit: I got a basic version working for now by just scrapping all the import stuff, setting tsconfig.json "module" to "none", adding a ///<reference types="phaser-ce"/> at the top of my game.ts and just including phaser.js in the html file. How it gets it's dependencies I still don't know but at least it works now. I also have no Idea where it gets the typings from, I guess it must be magic.
  2. Hello guys, I'm really not a Web/OSS dev, I know 3D and programming, but I have to admit that I struggle to find a "decent" setup to contribute to babylon.js. What I propose is to gather the best practices on this thread and I will make a documentation on the Github project to avoid unnecessary future "me" struggling in the dark. I read other topics, but they focus mainly on setup/building, what I can't get working decently is the editing/dev experience. I think I got the Git/Fork/NPM part ok, I can build Babylon.js using gulp. But, using VSCode or Visual Studio I really can't find a way to contribute to the project. VSCode shoots me some undefined types error, I don't know why. I don't know if I'm supposed to open VSCode on the babylon.js root directory or in the \src one. In any case I just can't have .ts file not complaining each time I open one. Visual Studio, well, from what I can tell the project is not setup to work with Visual Studio, I tried to tweak few things, but again, unsuccessfully. What I would like to achieve is a good dev experience, contributing on the lib and testing my changes right away in a local sandboxed example. A good start would be to write a guide for VSCode I guess but any other suggestions are welcomed. Thanks for your help
  3. How to contribute to Babylon.js

    Hello everyone! I just finished an article about how to contribute to Babylon.js engine (the exact same process can be applied to the Documentation, or any repository). It can be found here: http://pixelcodr.com/tutos/contribute/contribute.html It talks about creating a fork, cloning it, setting up Visual Studio compiler, and create a pull request. If you have any questions about it, I'll happy to help