EatMoreSpuds's Recent Forum Activity

  • I have a large project with several layouts, 2 of the layouts have instances of a family on them, the family appears nowhere else in the project.

    All was well until I added the physics behaviour to the family.

    Now, when moving between the 2 layouts with the family on I get this error message:

    "Javascript Error!

    Unable to get property GetLinearVeolcity of undefined or null reference

    http://blahblahblah/Physics_behavior.js"

    The layouts load fine from anywhere else in the project, and the physics behaviour works fine. its only on moving to the other layout with the same objects on it the problem occurs.

    I tried to make a clean project with only a couple of sprites with physics on them in to recreate the issue but can't recreate it.

    Any ideas? Thanks!

  • Thanks for the reply California - help is much appreciated! I wanted to pass the sprite itself as well as its position, as the function didn't know which specific sprite to create (to keep it generic)

    I did find a cool little work around actually, instead of using separate sprites for each number, I put all the different graphics into ONE sprite, as frames of an animation. Now I can create the same sprite for all numbers, and pass the frame number to show as a parameter. Not useful for all cases you want to pass an object to a function but works in this case!

    Thanks for the help all!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Cool, that sounds like it may well fit the bill - I will have a look at this plugin! Thanks! <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Hi all, I'm stuck on a way to get a function to reference a particular sprite which will change each time the function is called.

    I have a game which features small mini games for kids. At the end of each game a pop up window appears to say "well done! you made 3 cup cakes!" or whatever the child is doing.

    I created a function to create the pop up and reference the appropriate text from a dictionary so that all the mini games can use the same function and just pass parameters for the text string required, and also pass a parameter of the score value. This all works fine but now I'm trying to get clever and show the score number not as text but as a graphic - i.e. a sprite - so it looks big and pretty and has animation.

    The problem is how to pass the number sprite to the function so it can create and position it in the pop up window. I have 10 Sprites - the numbers 0 to 9. AFAIK I cannot pass a sprite (or other object) in a function parameter.

    I tried grouping the sprites in a family, and giving the family an instance variable which has the number the sprite represents (so the number 9 is set to 9, for example). Then I passed the score value as a numeric parameter and tried a Pick by evaluation, comparing the instance variable to the passed score parameter which should pick the right sprite, but after that I'm a bit stumped how to get that to show and position the sprite. the Create function just creates a random member of the family even after the picking process.

    Any other suggestions to pass a sprite to be created/positioned to a function?

    Thanks for any advice!

EatMoreSpuds's avatar

EatMoreSpuds

Member since 8 Aug, 2013

None one is following EatMoreSpuds yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies