Jump to content

function of the Sprite Object not recognized


Golden Gui
 Share

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

Link to comment
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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...