dude78

Members
  • Content Count

    48
  • Joined

  • Last visited

About dude78

  • Rank
    Advanced Member

Contact Methods

  • Website URL
    altstudy.com.ua
  • Twitter
    anotherdude78

Recent Profile Visitors

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

  1. 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.
  2. 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.
  3. 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
  4. 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?
  5. dude78

    cave2d.com/game5 is done

    Superb!
  6. 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
  7. dude78

    Sprite disoration, fake 3d

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

    Saving a Game in Phaser Easy Example?

    @Finwillwin, hello, I don't think so. As of me, I didn't understand your question.
  9. 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 :).
  10. 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
  11. 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
  12. dude78

    Click in the center

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

    Click in the center

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

    Detection zone

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

    Loading assets

    @tanmoy749, could you please show console messages?