andreyin's Recent Forum Activity

  • Ah, I think I finally understand how TokenAt works. I thought I would be able to change a value in a variable directly using it but it seems that's not the case, that's why you guys were telling me to use arrays.

    Well, I think I've got it figured out now.. thanks!

  • Thanks for the replies!

    I don't get it, why do you have an array for it if you can just use the TokenAt directly? You could use a for to check which levels have been cleared without a problem, I think.

    In my case I need to check if every level has already been cleared, so the player can be awarded an achievment..

    In any case, let's say I used an array to sort the variable. Still, how do I check that every item in the array is "1"?

    edit: I found a way to do it that's really simple, just not very pretty. I can manually compare the variable to "1,1,1,1,1,1,1,1,1,1,1,1", and if it is, the player is awarded the achievment.

    That bad part is that if I ever add more level, I'll have to change this.

  • I'm trying to use TokenAt/TokenCount to check if the player has cleared all my levels, instead of using a variable for each level.

    The thing is, I have a variable called "levelCleared" that's set to "0,0,0,0,0,0,0,0,0,0,0,0", where each 0 represents a level. When the player clears the level, it changes to it to 1.

    I thought about using a "For 0 to Tokencount(levelCleared,",")-1" like I saw here scirra.com/forum/for-each-tokenat_topic71638.html to check for it, but then how can I check if EVERY number equals to 1?

    Sorry if this is a dumb question.

    Thanks!

  • Really weird! I use Dropbox as a safety measure, and I highly recommend it. With Dropbox if something like this happens, you can right-click a file and see every old version it has, and download it. It's amazing.

  • CocoonJS translates the data to use Android/iOS cache, so it's the same as any other game.

    Have you actually tried it out? Write a quick app and use CocoonJS and Webstorage, it should work.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can use WebStorage to store variables and arrays in CocoonJS, I think.

    You're mistaking C2's save STATE function as a real save. The "save state" that C2 has is exactly like an console emulator save state - it saves everything. In WebStorage you can save arrays, variables and all that, then you can load it manually.

    Your save array idea is doable with the normal array, no problem.

  • Here's mine, Balloon Rescue:

    ludumdare.com/compo/ludum-dare-27

    <img src="http://www.ludumdare.com/compo/wp-content/compo2/273708/15858-shot0.png" border="0" />

  • The problem is that in your code you're just telling the platforms that, if the player is touching the screen, the platform should move or not, but you're not telling WHICH platform should be moving or not.

    To select an instance so it works you have to either use a "pick" condition (like platform -> pick nearesth/furthest) or use the "on object clicked" condition so it picks the platform you've clicked on.

    Here's the capx: dl.dropboxusercontent.com/u/2383513/linkedOUT/PhysicsGame.capx

    I've also made the platforms rotate only if you click on it's borders, hope you don't mind! I made 2 different image points on each side and compare them to wherever the player is touching, so if the distance between the touch and the imagepoints is less than 30, it rotates instead of moving.

  • No problem, glad to hear it worked!

  • Paradox I just found about about TokenAt this week and omg, wish I knew about it sooner. Would have saved me SO much trouble and variables that do basically nothing until a very specific condition is met.

  • You use the "scrolling" event.

    <img src="http://i.imgur.com/wAb8f7b.png" border="0" />

  • naelian you're right, and the game does work! But the platform behavior has some weird issues with low-fps, for instance, if you move a character to the right it keeps "warping".. I have tried to fix this before but to no avail, I still have to look into it using the debbuger.

    Also I thougth that the textbox update thing only really slowed down on CocoonJS? I'm aiming for a Node-Webkit release.

andreyin's avatar

andreyin

Member since 11 Jan, 2010

Twitter
andreyin has 1 followers

Connect with andreyin

Trophy Case

  • 14-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • x3
    Great Comment One of your comments gets 3 upvotes
  • x2
    Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

21/44
How to earn trophies