Jump to content

MarvinB

Members
  • Content Count

    37
  • Joined

  • Last visited

About MarvinB

  • Rank
    Advanced Member

Recent Profile Visitors

1227 profile views
  1. MarvinB

    FPS drop

    Hi Guys, I have multiple game states and one of them is kind of slow on mobile, while it works just fine on desktop. I ran a js profile to find out what could be the potential cause of this and attached it as a reference here. I know this image does probably not give away enough in order to make any clear predictions on what the issue for my fps drop is, but maybe the pattern of the times spent for the functions to execute yields something I could make use of. I commented out most of my update functions of that state to see whether the issue is hiding in there, but no success. The im
  2. MarvinB

    Phaser ES6

    I wrote a function that calls new game inside the function sandbox and appended this function to the global window object and it works just perfectly from outside of the script to call my function. Thanks a lot, Matt! Didn't even need to call any import of some kind.
  3. MarvinB

    Phaser ES6

    Hi Matt, First of all, thank you for taking the time and writing up all of this! Sorry, if I will mention something you already explained, but I still need to understand everything fully. So lets say I load my game-bundle.js script transformed earlier by babelify and an angular controller within my index.html <script src="scripts/phaser.js"></script> <script src="scripts/angular-controller.js"></script> <script src="scripts/game-bundle.js"></script> To mention here is that my angular code is not tranformed with babelify. So an ES6 import wi
  4. MarvinB

    Phaser ES6

    Hi Guys, I tried the window.game approach, but calling new window.Game(); did not create my game unfortunately. The game appears in the window object though. Are these exports registered somewhere globally? (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=ty
  5. MarvinB

    Phaser ES6

    Hi Guys, I have been using ES6 for my game development and I really enjoy the functionality it supports. I started of using this example (Boilerplate) and kept the gulp compiling/traversing script, as it suits my needs well. I ran into a little challenge, that I could not figure out yet, but maybe somebody else has a good idea on how to achieve the following: After the gulp script ran through it creates a build.js file, which starts like this (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if
  6. Thank you, guys! I tried Taggrin's recommendation first, as it seemed very plausible and applicable to my situation and indeed I just had to set a boolean flag that animation currently runs to avoid calling the animation over and over again. Thanks, again!
  7. Hi guys, I have a little problem with my character animations. My player can go into different directions. The movement is based on a body.velocity change. I want to play a different animation based on the direction my player is heading. I use a simple switch statement in which I call player.loadTexture(texture); playee.animations.add(texture, null, 30, true); player.animations.play(texture); While the texture changes and loads the first frame of my spritesheet, the animation does not play until the velocity is at 0 again. So while the player is moving nothing plays.
  8. I further narrowed it down Phaser.blendModes.MULTIPLY seems to not work on the phone. I am assuming since the canvas has to be cleared every time, the blendmode is just too much for my phone?
  9. Learned something new. Thank you!
  10. Why would I run the tasks myself? That's why something like gulp exists. But it is not a compiler, that's correct. Just use this as a starting point and strip out the states, its pretty simple: https://github.com/belohlavek/phaser-es6-boilerplate
  11. The error is saying it expects p1walk01 to be in the cache, but you never load it anywhere.
  12. You need the gulp compiler with babelfy to create a ES5 build file that runs in Mozilla
  13. For the set screen size error, try this: Phaser.ScaleManager.prototype.setScreenSize = Phaser.ScaleManager.prototype.updateLayout;
  14. Hi everyone, I am making an app with Phaser and the Intel XDK. I tried to implement some simple lighting and found a simple example online. As a reference: https://jsfiddle.net/dceq2vsu/1/ It works as expected on desktop, it also works in the mobile browser, but the shadow overlay does not show, if I compile it as an app. Is bitmap not working well on mobile phones?
  15. MarvinB

    Zoom

    Actually, found the issue. In Phaser set Object.defineProperty(Phaser.Camera.prototype, "position", { get: function () { this._position.set(this.view.centerX, this.view.centerY); return this._position; }, } fixes the issue.
×
×
  • Create New...