New Vec2f not working inside New Constructor ?

About Monkey 2 Forums Monkey 2 Programming Help New Vec2f not working inside New Constructor ?

Tagged: 

This topic contains 4 replies, has 4 voices, and was last updated by  gcmartijn 2 years, 8 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #2861

    gcmartijn
    Participant

    I’m trying to convert a Monkey code to  MX2 but, I get a strange error.
    In the old Monkey code I was using a Vector class, but I thought this is overkill so i’m was trying the Vec2f instead.

    What I have done is strip all the code to make it readable.
    When I run this code the program hangs at the point that inside the Player Constructor a method Move(x,y) is creating a New Vec2f

    In other words, I can’t create a Vec2f inside a method called by a Method New

    Now I’m thinking or its a bug, or its because its a struct thing ?
    Maybe Vec2f is not a replacement for the Vector class i’m using ?

    #2862

    Simon Armstrong
    Participant

    If you look over at your debug window you will see Self is null so I think your issue has nothing to do with Vec2f.

    Monkey2 does not treat null method calls as an error in debug mode.

    #2891

    peterigz
    Participant

    Think you’re just forgetting to add a new FrameSet to the map. Interesting that the method can be called on a null object though.

    #2892

    Mark Sibly
    Keymaster

    Interesting that the method can be called on a null object though.

    Yeah, I might yet change this, but mx2cc itself currently depends on this behaviour so it wont be for a while yet.

    #2893

    gcmartijn
    Participant

    @peterigz
    Yes that’s it, but have to re-check why monkey1 is doing it oke something like this.
    Thanks

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.