Coder Social home page Coder Social logo

play_phaser's People

Contributors

darkoverlordofdata avatar johnpryan avatar larsch avatar playif avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

play_phaser's Issues

NoSuchMethodError: method not found: '<'

I started seeing this error on the console log when I upgraded to 11.0 - I see it in 11.1 as well.
Class Menu extends the Phaser.State class. The log entry shows up when I click on a Phaser.Button object. Nothing seems broken, the behavior is working, it just logs exceptions.

Exception: Class 'Menu' has no instance method '<'.

NoSuchMethodError: method not found: '<'
Receiver: Instance of 'Menu'
Arguments: [1] package:play_phaser/gameobjects/image.dart:896Image.set:frame package:play_phaser/gameobjects/image.dart:896Button.setState package:play_phaser/gameobjects/button.dart:574Button.onInputOverHandler package:play_phaser/gameobjects/button.dart:450SignalBinding.execute package:play_phaser/core/signal_binding.dart:40Signal.dispatch package:play_phaser/core/core_signal.dart:160InputHandler._pointerOverHandler@290914109 package:play_phaser/input/input_handler.dart:818Pointer.processInteractiveObjects package:play_phaser/input/pointer.dart:652Pointer.move package:play_phaser/input/pointer.dart:526Mouse.onMouseMove package:play_phaser/input/mouse.dart:397Mouse. package:play_phaser/input/mouse.dart:301
Exception: Class 'Menu' has no instance method '<'.

NoSuchMethodError: method not found: '<'
Receiver: Instance of 'Menu'
Arguments: [1]

Transparency "true", doesn't have effect.

Game game = new Game(window.innerWidth, window.innerHeight, WEBGL, '', new Main(), true);

There is no difference between true or false, when i checked it in Main.create it is always false.

I took a look at Game constructor, mistake is probably there. :) ๐Ÿ‘

Question - Getting error when trying to return from a function (via a Completer) once a sound stops. Why?

I have a function like this that plays a sound and I want it to return only once the sound stops so I am trying to use a Completer.

  Future<bool> playAttackSound(AttackType type)
  {
    Sound s;
    Completer comp = new Completer();

    switch (type) {
    //init s based on type 
    ...
    }
    s.onStop.addOnce((Sound foo) => comp.complete(true));
    s.play();
    return comp.future;
  }
}

But...when I run my game once the sound plays I get these errors.

Closure call with mismatched arguments: function 'call'

NoSuchMethodError: incorrect number of arguments passed to method named 'call'
Receiver: Closure: (Sound) => dynamic
Tried calling: call(Instance of 'Sound', "")
Found: call(foo)

What's going on here?

Ninja AABB vs full tile

When using the ninja tileset along with AABB, the full tile(the tile with the ID of 1) returns an error stating that there are too many parameters for the function, projAABB_Full. Looking in the lib/physics/ninja/aabb.dart file, I noticed that the function projAABB_Full was missing the 'Tile t' parameter that even the comment documentation shows. While technically the function does not need that parameter, whatever calls it passes it, which means there will be an error whenever it is run. I was able to resolve the problem easily by simply adding that parameter.

Canvas not being put into page when running compiled .dart.js file

I recently decided to test trying to run the dart.js output of my project by setting up a site via Github pages. Unfortunately I get this error in the browser console and the canvas I try to insert via code is not there

Uncaught TypeError: Cannot read property 'append$1' of null

My site for it is here so if you open devtools in Chrome for example you can see a stack trace, with source-maps. Sadly I think I may have accidentally borked something with the source map because the links in the dev tools don't quite seem to link to what they say they do in some cases but it's still fairly ok.

I was trying to debug this issue with a friend and they mentioned that one slight issue in the Phaser code here as well is the Game constructor's param parent is typed String but really the code within accepts String or Element or something like that, so that's a little misleading.
Oh and another thing, when I use Points in my code I get a warning in DartEditor about how phaser.dart (lib file) implicitly hides Point from math package. So I think your library file import of dart:math should read like import 'dart:math' hide Point; It may not be an issue in my case with what I've been doing but to quote my friend when we were talking about my issue....if you don't hide things like so "Dart has to guess what you mean and may guess wrong".

Exception: The null object does not have a getter 'x'.

This error is coming from Sprite.update crop.:

//this._crop = Rectangle.clone(this.cropRect, this._crop);
this._crop.x += this._frame.x;

this._crop is null. If you un-rem the lines, there is no Rectangle.cone method.
It looks like Phaser.Rectangle.clone = function (a, output) {
isn't getting ported.

Question - How to pass values into init function of a state?

So I posted this on SO but I guess I have realised it's maybe a bit too localised for people there to care to give their time to help, my question is as the issue title says. My SO question is here: http://stackoverflow.com/questions/28264727/how-to-pass-values-to-phaser-dart-port-state-init-function

If you don't feel like reading the whole thing there is something of a TL;DR at the end...which explains the error I am running into which I understand the cause of but cannot solve.

Group.sort Class has no instance method '[]'.

I have a Group of entities and I use sort on it, like this

entities.sort('y', Group.SORT_ASCENDING);

But I get the following exception

Breaking on exception: Class 'PlayerEntity' has no instance method '[]'.

Might be broken due to a change in a newer version of Dart, the code in the library does not look wrong.

Can't use State subclass in different file

I understand that in the example of the readme you made a subclass of State, but when I attempt to separate the subclass into a different file, the error of "Exception: type 'TestState' is not a subtype of type 'State' of 'state'" comes up. I do not know if that's intentional or if it's because of my limited knowledge of dart.

went from this (one class only), it works

main() {
  Game game = new Game(800, 480, WEBGL, '', new TestState());
}

class TestState extends State {
  //the methods go here
}

to (2 files) not working for me

(Test.dart)

import 'TestState.dart';
main() {
  Game game = new Game(800, 480, WEBGL, '', new basic_01_load_an_image());
}

(TestState.dart)

class TestState extends State {
  //the methods go here
}

Your pubspec.yaml file is broken.

This is what's in master right now:

dependencies:
  browser: ">=0.10.0+2 <0.11.0"
  uuid: ">=0.3.2 < 0.4.0"
  play_pixi:
    path: ../play_pixi

Won't work unless for some reason a package user has checked out play_pixi locally.

Exception: The null object does not have a method 'cancel'.

I get this error when calling "scale.setScreenSize(true);" in ScaleManager.

This is the dart code that raises an exception:
this._check.cancel();

In the original, no exception is raised here when this_check is null -
Phaser.js does this:
clearInterval(this._check);

Thanks,
Bruce

Point operator overloading with num

Certain operations could be simplified further by adding operators to the Point class that use numbers rather than points

i.e

myPoint * new Point(2.0, 2.0); // without
myPoint * 2.0; // with

Question - Unable to get simple code akin to image loading example working.

I am on Win7 running latest Dart version and I have my dart file as below

import 'package:play_phaser/phaser.dart';

class PhaserTest
{
  void main()
  {
    Game game = new Game(800, 600, AUTO, 'output');
    State blah = new MyState();

    game.state.add('state1', blah);
    game.state.start('state1');
  }
}

//Phaser basics_1 example
class MyState extends State
{
  Sprite image;

  preload() {

    //  You can fill the preloader with as many assets as your game requires

    //  Here we are loading an image. The first parameter is the unique
    //  string by which we'll identify the image later in our code.

    //  The second parameter is the URL of the image (relative)
    game.load.image('car', 'bunny.png');

  }

  create() {

    //  This creates a simple sprite that is using our loaded image and
    //  displays it on-screen
    image = game.add.sprite(game.world.centerX, game.world.centerY, 'car');

    //  Moves the image anchor to the middle, so it centers inside the game properly
    image.anchor.set(0.5);

    image.scale.set(2);
  }

  update() {
    image.angle += 1;
  }
}

When I click my index.html to "Run in Dartium" and it loads, there is nothing but a blank tab...I don't understand, have I really done something wrong here or is something broken? :( I mean really, my code is just like your first example. To clarify, bunny.png IS in the web directory of the same project and output is a div in the body of my html.

dart:mirrors - is it really needed?

****************************************************************
* WARNING: dart:mirrors support in dart2js is experimental,
*          and not recommended.
*          This implementation of mirrors is incomplete,
*          and often greatly increases the size of the generated
*          JavaScript code.
*
* Your app imports dart:mirrors via:
*   ef-client.dart => package:play_phaser => dart:mirrors
*
* You can disable this message by using the --enable-experimental-mirrors
* command-line flag.
*
* To learn what to do next, please visit:
*    http://dartlang.org/dart2js-reflection
****************************************************************

[Warning from Dart2JS]:
2530 methods retained for use by dart:mirrors out of 4921 total methods (51%)

is this really needed? Could it potentially be removed?

Animations are super fast

Since I like Phaser but I'm not really big on Javascript nor CoffeeScript but really like Dart, I decided to give this a try. I'm having an issue where all animations play super fast, no matter what framerate I pass as a parameter. Is this a known issue? If not, I could provide you some more information

p.s: Will support for play_phaser stay consistent in the future as new Phaser releases come out, or is this just like a side project that might be dropped at any given time?

Group.sort turns the scene black

The ugly exception is gone but calling the sort method now renders the scene completely black.

entities.sort('y', Group.SORT_ASCENDING);

I'm adding two sprites to that group, I find it kind of odd that it would render the whole scene black

physics.enable on Sprite with child/Group give RangeError

easy step to reproduce:

//create shadow
this.shadow = game.add.sprite(x, y, 'tank', 'shadow');
//then the tank body
this.tank = game.add.sprite(x, y, 'tank', 'tank1');
//attach shadow to tank, so they will move togheder
tank.addChild(shadow);
//now activate physics!
game.physics.enable(tank, Physics.ARCADE, false); // <-- it break the engine!

Game class constructor parent parameter not working

Game class constructor parent parameter not working.

 :
<body>
    <div id="aaaaa"></div>
</body>
 :
void main() {
  Game game = new Game(800, 450, WEBGL, 'aaaaa', new SampleState());
}
 :

Canvas is appended body bottom.

 :
<body>
  <div id="aaaaa"></div>
  <canvas ... ></canvas>
</body>
 :

Thank you.

ScaleManager depends on "if (Null)" for isFullScreen

In Dart, if (Null) and if (!Null) cause type errors.

ScaleManager depends on !isFullScreen evaluating like isFullScreen == Null in at least one line of code.

If the following lines of code are placed in the preload() method for a State implementer:

game.scale.scaleMode = ScaleManager.SHOW_ALL;
game.scale.setScreenSize(false);

A type error occurs at line 1108 in scale_manager.dart:
} else if (!this.isFullScreen) {

isFullScreen should probably be initialized to false.

type error if timer delay is an integer

The timer crashes with a type error when triggered if the given delay is an integer.

The property Timer._newTick should be a num or the calculated value should be converted to a double when updating it. Or the Timer.add() should take a double and not a num.

To reproduce:

timer = game.time.create();
TimerEvent te = timer.add(1000, () => print("timer called"));

This will crash after 1000ms with: type 'int' is not a subtype of type 'double' of 'value'.

Delay before new animation plays

In a class which extends Sprite

animations.play('run-down');

The animation doesn't immediately replace the old one (probably waits for the last frame of the old animation to end)

text no change

Hello,

I tried your example basic_02_click_on_an_image, click makes nothing .


Other thing:

create(){
   image = mygame.add.sprite(mygame.world.centerX, mygame.world.centerY, 'man');
   image.anchor.set(0.5,0.5);
   image.inputEnabled = true;
   image.events.onInputDown.add(listener);
   texty = mygame.add.text(250, 16,"click on picture", new TextStyle(fill:'#ea4c89'));
   texty.setText("I changed");
}

setText("I changed") doesnt. (refresh text or on console)


Other thing:

create(){
  image = mygame.add.sprite(mygame.world.centerX, mygame.world.centerY, 'man');
  image.anchor.set(0.5,0.5);
  image.inputEnabled = true;
  image.events.onInputDown.add(listener);
  texty = mygame.add.text(250, 16,"click on picture", new TextStyle(fill:'#ea4c89'));
}

when a use a listener

listener(Sprite s, Pointer p){
   counter++;
    texty.setText("change");
    texty.text= "change $counter";
    Dom.window.console.log(texty.text);
}

Text change only I use setTex() and texty.text both.
If I use only setText("changed") or texty.text = "changed", it doesnt

remark: when I look the console texty.text change but no refresh the picture, but setText() make nothing.

I hope you understand and helped you.

Gi

ninja AABB vs AABB collision issue

Hi, I am running the example ninja_AABB_vs_AABB, when the untinted block collides into the tinted block from the left, the tinted block pushes back, which doesn't look right. When colliding from the right side it works just fine

Input events broken for Text objects

Hi, the input events for Text objects seem to be broken
example:

  create() {
    TextStyle style = new TextStyle(font:'100px Arial', fill: 'white');
    Text play = game.add.text(0, game.world.centerY, 'Play', style);
    play.inputEnabled = true;

    //this doesn't work
    play.events.onInputDown.add((a, b) {
      print("play");
    }, 1);

    Sprite sprite = game.add.sprite(game.world.centerX + 64, game.world.centerY, 'grass');
    sprite.inputEnabled = true;

    //this does
    sprite.events.onInputDown.add((a, b) {
      print("grass");
    }, 1);
  }

Upadate to Phaser 2.6.2

Thanks for this project it's really helpful! Would it possible to update to the latest Phaser version?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.