lionz's Recent Forum Activity

  • You give local storage item a value but after you already checked local storage. Just set cash to 1 in the missing event. If it is showing NaN later when you grab it then refer back to the int conversion I mentioned above.

  • Set cash to int(localstorage.itemvalue), it converts the string to an int. Did you make those events as you mentioned or did you take it from an example file?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think the local storage value is a string so you have to use int(localstorage.itemvalue) if cash is a number.

  • You could make the objects global (not on a global layer) and use persist but this is kind of messy as you have to pick instances. I prefer to have the global hud layer for visual side and instead use global variables, this is more the norm I would think.

    The inefficient function you talk about, you are always going to need something to set the displayed values. You can either put it at the top of each event sheet or call it from one main event sheet that links to all layouts.

  • You do not have permission to view this post

  • Old data is retained on update. If you uninstall it will delete everything. Apps usually update automatically.

  • Right now it will pick all snakes because none is specified. To pick one you need to pass through the snake UID through the function and use it.

    You should add a parameter to the function. When you call it, the parameter is the snake's UID.

    Inside the function you add a condition, pick snake by UID where the value is the parameter. This then refers to that snake that collided with the object.

  • In Construct you pick the Sprite you want with conditions so on the left you pick sprite where variable = health, then with actions you say set text to Sprite.value.

    A more normal way though is to use a global variable for health then you can just say set text to health variable without using sprites.

  • You do not have permission to view this post

  • You do not have permission to view this post

  • You do not have permission to view this post

  • The loopindex has no effect and would probably break the loop. Take that out first. Then if nothing is spawning you can debug with Browser object and 'log', you can see what value in the array it finds. You don't have any handling for if it can't find the parameter string. We also don't see how you call the function. Do some logging and work it out. If it's spawning at 0 it might not be able to find anything, you have a lot of conditions that if just one isn't true then nothing will happen, it's down to you to put some logging in and try and find the exact place it goes wrong then you can work out why.

lionz's avatar

lionz

Member since 5 Aug, 2013

Twitter
lionz has 73 followers

Trophy Case

  • 11-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

24/44
How to earn trophies