dude78

Members
  • Content Count

    52
  • Joined

  • Last visited

Everything posted by dude78

  1. dude78

    I need a REAL book to learn and study the phaser2

    For Phaser 2 phaser.io/interphase
  2. dude78

    create: function() => unexpected token :

    @Colon, Just there is no point to use it. If you need sth to be done when this state called, just add it either to create or init function. That code ("bad code") does nothing. But if I got your idea, a tip above might be useful. I didn't run it yet. I even don't whether it's for free or not. I'll take a look at it later and let you know then.
  3. dude78

    Black screen over game

    @damager, presume, would be better to provide your post with a video. Also, I can't understand why do you need to use RESIZE to handle scale. How does it help with black screen? As of me there is little information. Suppose you know that there are functions as "enterIncorrectOrientation" and "leaveIncorrectOrientation" to handle game behaviour in case of device rotation.
  4. dude78

    create: function() => unexpected token :

    @Colon, why do you need to use immediately called function? (function() If you still want to use "(function(){})()", I assume this code will be useful for you: 'use strict'; Game.dialog = function state(game) {}; (function() { Game.dialog.prototype = { create: function () { console.log("here we are..."); } } })(); but I can't imagine why do you need to do so. There is no point of it... (So it's a bad code); So Conv.play() is not a function. What is Conv at all?
  5. dude78

    create: function() => unexpected token :

    I just had a look at your code. I did so before but now I got it. Try to rewrite your code, divide it into states and show what did you get. I'll try to help you then if you get stuck.
  6. dude78

    create: function() => unexpected token :

    @Colon, well... Shame on me I didn't work with modules yet. But. About using of states. Here is JUST EXAMPLE (Even don't know whether the following information will be useful for you): Let's assume we have 3 files: index.html, preloader.js, application.js. index.html: <!doctype html> <html> <head> <title>My App :)</title> <meta charset="utf-8"> <script src="../libs/phaser/phaser2/2.11.1.js" type="text/javascript"></script> <script src="js/application.js" type="text/javascript"></script> <script src="js/preloaded.js" type="text/javascript"></script> </head> <body> <script type="text/javascript"> var game = null; document.addEventListener("DOMContentLoaded", function(event) { game = new Phaser.Game({ width: window.innerWidth * window.devicePixelRatio, height: window.innerHeight * window.devicePixelRatio, renderer: Phaser.WEBGL_MULTI, parent: '', transparent: false, antialias: true, physicsConfig: null, preserveDrawingBuffer: true, enableDebug: false }); // add states to State Manager game.state.add('Preloader', MyGame.Preloader); game.state.add('Application', MyGame.Application); // start "Preloader" state game.state.start('Preloader'); }); </script> </body> </html> preloader.js: var MyGame = { }; MyGame.Preloader = function (game) { }; MyGame.Preloader.prototype = { // this function will be called first init: function () { }, // second preload: function () { this.load.path = "assets/images/"; this.load.images(["image1", "image2"]); this.load.path = "assets/sprites/"; this.load.atlas("sprite1"); this.load.atlas("sprite2"); }, // third create: function () { // here we start a new state "Application" this.state.start("Application"); }, }; application.js: MyGame.Application = function (game) { }; MyGame.Application.prototype = { init: function () { }, create: function () { }, update: function () { }, render: function () { }, }; So we can call each state as an object with its methods (such as init, create, update, render, loadupdate and more...) I'd recommend you to read Interphase book. As of me it is the best book for phaser 2. States are explained there too.
  7. dude78

    Calculate needed y velocity for given y point

    Hi, @kodyrouse. Did you solve your problem? One simple tween slow your game down? It's better to show at least the part of your code then. I read questions and see "Phaser 2.6.2" from time to time. There is Phaser 2.11.1 as I remember as of now and documentation is available here: photonstorm.github.io/phaser-ce
  8. dude78

    create: function() => unexpected token :

    @Colon, Hello. 1. Did you solve the problem? 2. Do you need an example how to create state(s) and use them?
  9. dude78

    cave2d.com/game5 is done

    Superb!
  10. dude78

    Spacedust Defender - a maze TD with a small twist

    Hi @hopeslicer. Unfortunately, I can't play it. After first level completes I see nothing but black screen and some stuff. Why does it happen? In case you'd like to see what's going on in console: But it works fine here: https://www.kongregate.com/games/hopeslicer/spacedust-defender
  11. dude78

    Sprite disoration, fake 3d

    @tihoho, Wayback machine did. https://web.archive.org/web/20161212104624/http://ds-code.net/?p=1 2.5dPhaserGame.zip
  12. dude78

    Saving a Game in Phaser Easy Example?

    @Finwillwin, hello, I don't think so. As of me, I didn't understand your question.
  13. dude78

    [Phaser 3] Swordy Archer: First Target

    @kiklop133, you could also give opportunity to restart at least the last level with other bow. I like that game, thank you :).
  14. dude78

    [Phaser 3] Swordy Archer: First Target

    @kiklop133, I believe this is a bug. Level couldn't be completed even if there are no enemies. archer.mkv
  15. dude78

    onSizeChange triggering function from wrong state

    this.game.scale.onSizeChange.dispose(); https://photonstorm.github.io/phaser-ce/Phaser.Game.html#scale -> https://photonstorm.github.io/phaser-ce/Phaser.ScaleManager.html#onSizeChange -> https://photonstorm.github.io/phaser-ce/Phaser.Signal.html -> https://photonstorm.github.io/phaser-ce/Phaser.Signal.html#dispose
  16. dude78

    Click in the center

    Or check coords when click events is called.
  17. dude78

    Click in the center

    You could create another small object and place it at the center.
  18. dude78

    Detection zone

    See https://photonstorm.github.io/phaser-ce/Phaser.Physics.Arcade.Body.html.
  19. dude78

    Loading assets

    @tanmoy749, could you please show console messages?
  20. Hello all. I have a problem with Chrome on Android. When I switch to a fullscreen I can get different results: First one (all is ok): The Second one (a white band at the bottom): The third one when I leave fullscreen mode (white band at the top): I use the following code: this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; this.scale.fullScreenScaleMode = Phaser.ScaleManager.SHOW_ALL; this.scale.pageAlignHorizontally = true; this.scale.pageAlignVertically = true; this.scale.forceOrientation(true, false); this.scale.enterIncorrectOrientation.add(this.enterIncorrectOrientation, this); this.scale.leaveIncorrectOrientation.add(this.leaveIncorrectOrientation, this); I get such results only in Chrome on Android. Does anybody know why this occurs and how to solve the problem? Any tips would be appreciated!
  21. dude78

    image top of rectangle

    @ruslanfan, did you solve the problem?
  22. dude78

    image top of rectangle

    @ruslanfan, Why did you set width of Rectangle to -100? https://photonstorm.github.io/phaser-ce/Phaser.Rectangle.html#Rectangle
  23. dude78

    Firefox Slow FPS

    Huh... I get slow fps in Chrome but not firefox (desktop). On mobiles all works fine.
  24. dude78

    [WIP] Strange Platformer Game

    @Webdva, no. The screen flickers even when I don't record the video.
  25. dude78

    lebeling sprites

    @tanmoy749, I just can't understand... Why this (Jobs) topic?