

notalentgeek
Members-
Content Count
50 -
Joined
-
Last visited
About notalentgeek
-
Rank
Advanced Member
- Birthday 01/29/1993
Contact Methods
-
Twitter
notalentgeek
Profile Information
-
Gender
Male
-
Location
Enschede
-
Interests
I want to make a small story based game studio.
Recent Profile Visitors
-
How can I know frame or how to set frame in an animated `Phaser.Creature`?
notalentgeek replied to notalentgeek's topic in Phaser 2
Up... up :). -
How can I know frame or how to set frame in an animated `Phaser.Creature`?
notalentgeek replied to notalentgeek's topic in Phaser 2
Up... up :). -
How can I adjust `Phaser.Creature` height and width proportionally?
notalentgeek replied to notalentgeek's topic in Phaser 2
I found a weird behavior.... dragon_character.play(true); // `true` is used for looping forever. dragon_character.scale.set(1); console.log("=========="); console.log("after setting up scale and before setting up width and height"); console.log("scale.x = " + dragon_character.scale.x); // `1`, which is expected. console.log("scale.y = " + dragon_character.scale.y); // `1`, which is expected. console.log("height = " + dragon_character.height); // `undefined`, which is expected. console.log("width = " + dragon_character.width); // `undefined`, which is expected. console.log("=========="); dragon_character.height = dragon_character.scale.y*100; dragon_character.width = dragon_character.scale.x*100; console.log("=========="); console.log("after setting up scale and after setting up width and height"); console.log("scale.x = " + dragon_character.scale.x); // `0`, which is NOT expected. console.log("scale.y = " + dragon_character.scale.y); // `4.138100158128295`, which is NOT expected. console.log("height = " + dragon_character.height); // `100`, which is expected. console.log("width = " + dragon_character.width); // `0`, which is expected, if the `scale.x` is indeed `0`. console.log("=========="); dragon_characters.push_with_limit(dragon_character); Here is my full codes: https://pastebin.com/fk5ZZ5e8. -
What is "no constructor" error? Details are inside.
notalentgeek replied to notalentgeek's topic in Phaser 2
Yea, I just figure it out myself. But this does not explain why `Uncaught TypeError: PIXI.Point is not a constructor` error happened. Neither, there is no information in the documentation. Is there any JavaScript file that I should never import to the HTML file?- 6 replies
-
- constructor
- error
-
(and 2 more)
Tagged with:
-
How can I adjust `Phaser.Creature` height and width proportionally?
notalentgeek posted a topic in Phaser 2
I am currently learning Phaser by doing some examples. I am currently here: https://phaser.io/examples/v2/animation/creature-dragon-multiple. I am wondering, how can I set the height and width of `Phaser.Creature` object? The default `height` and `width` are set to undefined. Hence I need to set both height and width in order to set the `Phaser.Creature` dimension. Here are some codes. dragon_character.play(true); // `true` is used for looping forever. dragon_character.scale.set(20); dragon_character.height = 100; dragon_character.width = 100; console.log(dragon_character.height); // 100. console.log(dragon_character.width); // 100. Here are another codes. dragon_character.play(true); // `true` is used for looping forever. dragon_character.scale.set(20); dragon_character.height = 100; console.log(dragon_character.height); // 100. console.log(dragon_character.width); // Undefined. // Additionally the animation does not show up in the screen. If I only set either height or width, the `Phaser.Creature` will not show up in the screen. I don't know if there is no way to set height and let the width adjusted proportionally (vice-versa). Additionally, I could not found a way to get the height and width properties if the dimension is set with `Phaser.Creature.scale.set(25)`. To sum up, my questions: Is there any way to set either height or width and let the un-set properties to adjust in proportion? How can I know the `Phaser.Creature` height and width if it is set with `Phaser.Creature.scale.set()`? -
What is "no constructor" error? Details are inside.
notalentgeek replied to notalentgeek's topic in Phaser 2
Finally, a respond. I have downloaded twice the library from `npm` the error still persists.- 6 replies
-
- constructor
- error
-
(and 2 more)
Tagged with:
-
How can I know frame or how to set frame in an animated `Phaser.Creature`?
notalentgeek posted a topic in Phaser 2
Doing the multiple dragon example here: https://phaser.io/examples/v2/animation/creature-dragon-multiple. Is there anyway so that both dragon appear at the same time, but each starts its animation on different frame? -
What is "no constructor" error? Details are inside.
notalentgeek replied to notalentgeek's topic in Phaser 2
Up please... someone knows about this issue?- 6 replies
-
- constructor
- error
-
(and 2 more)
Tagged with:
-
I am currently learning Phaser by doing examples. Got into the dragon creature example, I need to import additional add-ons for Phaser. I tried to import these JavaScript files. <script src="{{ node_modules_root }}/node_modules/phaser-ce/build/custom/phaser-minimum.js"></script> <script src="{{ node_modules_root }}/node_modules/phaser-ce/build/custom/phaser-no-physics.js"></script> <script src="{{ node_modules_root }}/node_modules/phaser-ce/build/custom/phaser-split.js"></script> <script src="{{ node_modules_root }}/node_modules/phaser-ce/build/custom/pixi.js"></script> These files are irrelevant for the dragon example. But, interesting error happened, `... is not a constructor`. For example `pixi.js:76 Uncaught TypeError: PIXI.Point is not a constructor`. The error happened when I imported the JavaScript file, even without any other JavaScript codes written. Why is that so? Can some explain what this error meant to me? And why the error happens by importing the JavaScript files? Example of the error. Uncaught TypeError: PIXI.Point is not a constructor at Phaser.Stage.PIXI.DisplayObject (pixi.js:76) at Phaser.Stage.PIXI.DisplayObjectContainer (pixi.js:904) at new Phaser.Stage (phaser-split.js:9193) at Phaser.Game.boot (phaser-split.js:13780) at Phaser.Device._readyCheck (phaser-split.js:40872)
- 6 replies
-
- constructor
- error
-
(and 2 more)
Tagged with:
-
Solved. From the most recent Phaser version, I need to import these .js files. <script src="{{ node_modules_root }}/node_modules/phaser-ce/build/phaser.js"></script> <script src="{{ node_modules_root }}/node_modules/phaser-ce/build/custom/creature.js"></script> <script src="{{ node_modules_root }}/node_modules/phaser-ce/build/custom/p2.js"></script> <script src="{{ node_modules_root }}/node_modules/phaser-ce/build/custom/phaser-arcade-physics.js"></script> <script src="{{ node_modules_root }}/node_modules/phaser-ce/build/custom/phaser-creature.js"></script> <script src="{{ node_modules_root }}/node_modules/phaser-ce/src/animation/creature/CreatureMeshBone.js"></script> Hence, I think the documentation here: https://photonstorm.github.io/phaser-ce/Phaser.Creature.html is not valid anymore. It says that I need to compile my own version of Phaser with `Creature` included. Whereas `Creature` is now implemented by default.
-
The main.html file. <!doctype html> <html> <head> <meta charset="utf-8" /> <link href="{{ root }}/app.css" rel="stylesheet" type="text/css"> </head> <body> <div class="flex-basic flex-row"> <div class="flex-1"></div> <div class="flex-basic flex-column"> <div class="flex-1"></div> <div id="phaser"></div> <div class="flex-1"></div> </div> <div class="flex-1"></div> </div> <script src="{{ node_modules_root }}/node_modules/phaser-ce/build/phaser.js"></script> <script src="{{ node_modules_root }}/node_modules/phaser-ce/build/custom/creature.js"></script> <script src="{{ node_modules_root }}/node_modules/phaser-ce/build/custom/p2.js"></script> <script src="{{ node_modules_root }}/node_modules/phaser-ce/build/custom/phaser-arcade-physics.js"></script> <script src="{{ node_modules_root }}/node_modules/phaser-ce/build/custom/phaser-creature.js"></script> <script src="{{ node_modules_root }}/node_modules/phaser-ce/build/custom/phaser-minimum.js"></script> <script src="{{ node_modules_root }}/node_modules/phaser-ce/build/custom/phaser-no-physics.js"></script> <script src="{{ node_modules_root }}/node_modules/phaser-ce/build/custom/phaser-split.js"></script> <script src="{{ node_modules_root }}/node_modules/phaser-ce/build/custom/pixi.js"></script> <script src="{{ root }}/bunch_of_functions.js"></script> <script src="{{ root }}/decorators.js"></script> <script src="./app.js"></script> </body> </html> The app.js. var game = new Phaser.Game(800, 600, Phaser.WEBGL, 'phaser-example', { preload: preload, create: create }); function preload() { game.load.image('sky', 'assets/background.png'); game.load.image('dragonTexture', 'assets/dragon_character_texture.png'); game.load.json('dragonMesh', 'assets/dragon_character_mesh.json'); } var dragon = null; function create() { game.add.image(0, 0, 'sky'); dragon = game.add.creature(450, 350, 'dragonTexture', 'dragonMesh'); dragon.scale.set(25.0); dragon.play(true); // true = loop } Error: pixi.js:76 Uncaught TypeError: PIXI.Point is not a constructor at Phaser.Stage.PIXI.DisplayObject (pixi.js:76) at Phaser.Stage.PIXI.DisplayObjectContainer (pixi.js:904) at new Phaser.Stage (phaser-split.js:9193) at Phaser.Game.boot (phaser-split.js:13780) at Phaser.Device._readyCheck (phaser-split.js:40872)
-
How can I know all animations that have been added into AnimationManager?
notalentgeek replied to notalentgeek's topic in Phaser 2
Found the solution, `Object.keys(sprite.animations._anims)`. The codes return a list of string. -
How can I know all animations that have been added into AnimationManager?
notalentgeek posted a topic in Phaser 2
Let say, with `sprite.animations.add("run");` I add an animation to an AnimationManager object. How can I see what animations are already there? Looking through, it is actually in `sprite.animations._anims` but it is listed as an object that cannot be read systematically (for example, `sprite.animations._anims[0]`). -
Why my `phaser_game` is `undefined` here?
notalentgeek replied to notalentgeek's topic in Coding and Game Design
It is in `preload()` regardless I have solved this problem. It seems, it was misunderstanding from my part. -
Why my `phaser_game` is `undefined` here?
notalentgeek replied to notalentgeek's topic in Coding and Game Design
This is ain't good I am moving back to vanilla JS XD.