Jump to content

LTNGames

Members
  • Content Count

    71
  • Joined

  • Last visited

1 Follower

About LTNGames

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. As rich said, no right or wrong answer. I generally recommend pure vanilla JS for coding newbies, mainly for a couple reasons. The main reason being tutorials are abundant and second TypeScript is compiled to JavaScript. To me learning why Typescript was made, by using the language it was conjured for, is generally a good idea. Nonetheless I believe the tutorials alone are the main reason, if you need answers you'll find them quicker for vanilla JS than you will with Typescript. If you are already a knowledgeable programmer then really it's just a choice between having types or not. Happy codi
  2. Looking good, I enjoy the sound effects and pretty art. Good job! lol, actually Flappy Bird is a copy of an even older game and I remember playing it early 2000s before Smartphones were a thing and Adobe Flash ruled the internet with their games.
  3. I'm really glad you answered this question for me, you covered so many different aspects in such a great way. It seems to me that for now, it's best not to use a module system for these types of projects I'm doing, which I have no problem omitting from my plugins. The way I did it before ES6 conversion, I was just wrapping my core functions in an IIFE and exported only 1 main objects which contained the functions I wanted, a classic ES5 module pattern. I think my best solution without bundling my core plugin with all the other plugins that utilize it, is to do it the classic way, at least unti
  4. Good, glad it works for you. Scoping is the first thing you will battle with when programming in javascript, youll catch on fairly quick though.
  5. You're using a variable to define your player, the variable is local to the function only and not available outside of it, you must declare the player as a property of the prototype in order to access it in the prototypes functions. var game = game || {}; game.Game = function(){}; game.Game.prototype = { preload: function() { console.log('passed'); var direction; var tile; }, create: function() { console.log('reached'); this.add.sprite(0, 0, 'sky'); this.add.sprite(0, 0, 'armor'); this.player = this.add.sprite(0, 0, 'dude'); this.game.physics.arcade.
  6. I'm having a bit of an issue with compiling ES6 code to es5 with import and export syntax. I'm not even sure if it's possible but what I'm trying to do is convert a few of my RPG Maker MV plugins to ES6, I rewrote one plugin in full ES6 with the export keyword to export a few of my objects. Now, the point of this specific plugin is to have common functions all in this one file that I call a core file, that I can later import it's functions and objects into my future plugins and any other ones I decide to rewrite into ES6. The thing is, I did some reading and been told in order for the compile
  7. Brackets should automatically detect most methods as long as you have the phaser.js in your project directory, I don't recall having to set up code completion for brackets and I used it for months, one of my favorite editors, unfortunately, it's a little too slow to respond to larger projects.
  8. Hmmm, it;s been a while since I've used phaser but I think it has to do with the fact you're creating the function in global scope which in your case would be the window scope, and when using the keyword 'this' it's searching through the window space for add.group(); which would be non-existent there because it's phaser namespace specific. I believe what you would have to do is make that function a prototype of BasicGame.Game so that you can access the normal inheritance of phaser For example, something like this should work for you. BasicGame.Game.prototype.createButtons = function
  9. For me, I'm used to working with larger files 2000 lines or less(not really all that large, but to some it is) so I like to organized my code in about 3 - 4 files depending on the project. Usually states, sprites, managers and windows (if required) if I have specific mechanics I like to make a plugin which can be used in more than one game so ill do that and keep the logic separate from the game. The managers file can usually used in more than one game as well, as its basically just functions with asset urls and global functions. Other than that it's really all personal taste and how you like
  10. Since I've started with JS I have always used === not because I knew much about it but because I've always used a linter, it's a habit now to use triple equals and feels unnatural when I don't use it. Thank you for chiming in and giving me your 2 cents on the subject it gives me peace of mind. Not often that I run into a scenario where double equals is required and I have been programming in JS off and on for at least 8months and if it's ever required, like you said there are better ways to accomplish same results. Thanks again, cheers.
  11. You know, I thought about this myself but JShint & JSLint tell me otherwise, it says to use === when comparing to 0 and at the moment both give me the same outcome. I'm still getting used to JavaScript and I find JSHint helps a lot but in this case, I'm confused.
  12. Wow, so easy almost makes me look bad hahah. Almost 8months I been dabbling in JS with RPG Maker & Phaser and I have never seen the % sign being used until today. Thank you for this very simple solution and you have motivated me to do more research for Javascript. My final function looks like this. I had to add in the time objects second property so it would not update for the entire minute but easy enough. Thanks again, I'll be sure to ask my question in this community for now on. Game_Time.prototype.updateTimeEvents = function () { var currentTime = this.time; if(currentT
  13. Okay, to start I'm creating a plugin for RPG Maker MV for my game, don't worry I don't expect many people here to have much knowledge on that engine. My question is not related to MV specifically but to a time system I'm creating. So far I have the whole system in working order, there is one feature I am attempting to get working and my brain is not capable of solving it at the moment lol. So, basically, I am making a feature that allows the player to time travel and I want to set up an update function that will record an event(location & time) every few minutes (set by the developer using
  14. I use groups for all my windows in my game which is just a group of buttons, text and what not. I found lewster32 has an excellent workaround for the group scaling and I use it in my project. It should be what your looking for. Find it here http://jsfiddle.net/lewster32/skhsbkk4/
  15. Nice, very useful. I will test it out sometime today. Thanks for sharing
×
×
  • Create New...