Golden Gui

function of the Sprite Object not recognized

Recommended Posts

Hello everyone, 

 

i'm facing an issue pretty weird discovering the melonJS framework following the space invaders tutorial. When i try to implement the player movement actions, i get a problem on the clamp function of the Sprite Object. I'm more from the TypeScript world so not really used to the old way making objects on js, but i verified the melonjs.js file, and the function seems to be implemented well into the object. I use the last release of the boilerplate by the way. 

 

Thanks in advance. 

issue.jpg

Share this post


Link to post
Share on other sites

Hi, since the 6.0.0 version we sandboxed all previous extensions under our me namespace :

https://github.com/melonjs/melonJS/wiki/Upgrade-Guide#5xx-to-600

As a consequence the clamp method is since then only available through me.Math.clamp()

http://melonjs.github.io/melonJS/docs/me.Math.html#clamp

rather do : pos.x = me.Math.clamp(val, min, man) should fix your issue.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.