dop2000's Recent Forum Activity

  • Yes, exactly, they are temporary, for storing something temporarily inside an event or function or event group etc. Another important thing about local variables is that they are visible and accessible only from inside of this event/function/group.

    .

    You create them the same way as global variables - just press V.

    You can also make them not temporary by ticking "Static" checkbox. Static variables retain their value forever (until you change it or exit your game of course).

    .

    Static variables may be quite useful. For example, you can create an event group "AUDIO" for all your audio events. Add a static local variable "audioVolume" in this group. Then even if you restart the game and reset all global variables, audioVolume will not be reset.

  • Well, I still don't understand why your player can retain high speed by jumping all the time. This doesn't happen in my example.

    Also, dt*50 basically equals 1, and using lerp function with "1" as its third parameter has little sense. Your speed will revert to 200 almost instantly, in 1 or 2 ticks. So you can just set max speed to 200, without any formulas.

    .

    There is a difference between using lerp() like this and subtracting a fixed value every tick. With lerp you get high deceleration in the beginning and slow deceleration in the end. Subtracting is linear. See this example:

    dropbox.com/s/u3ybujq2ssg1yg8/SlowingDownTwoFunctions.capx

    .

    Finally, you shouldn't worry about the performance of math functions, unless you are calling them millions of times every second.

  • This is odd, maybe WebGL gets disabled in Cocoon?..

    Have you tried packaging with PhoneGap?

  • Search for this post in google and open cached version.

    Or try web.archive.org

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm feeling extra generous today, so I made this example of an inventory system with arrays and dictionaries. (actually, updated one of my older demo projects).

    Click items to pick them up. Enjoy!

    dropbox.com/scl/fi/azv4q1ckfjjt7uq50v946/InventorySystem.c3p

  • To make the enemy to follow your player more naturally (with inertia), you can use 8-Direction behavior:

  • Most effects are slow on mobile, but are you sure that they are the main reason of poor performance? Are you getting reasonably good FPS if you disable all effects?

    One way of optimizing effects is to apply them to layers instead of objects. One effect applied to the entire layer will work faster than the same effect applied to several separate sprites.

    You can probably replace these effects with blend modes (like "destination out"), they may work faster.

    Also try not to use "Force own textures" setting on layers, as it also causes slowness. Unfortunately, some effects/blend modes require it.

    .

    There have been lots of discussions about this topic, try googling (since Search function on this new forum doesn't work yet).

  • camboriu

  • Variables (global or instance) are not very convenient for this purpose.

    Dictionaries and arrays are much easier to work with, because you can export/import them with one action (as JSON).

    So I'd recommend putting all data that needs to be saved into one or several dictionaries and export them as JSON to a text file.

  • And now... to create zillions of variables for each of my items! :D

    Joking aside - things like this is the reason why so many beginners never finish their games. It may take a few hours to read about the features like dictionaries, arrays, families etc., but they will save you weeks and months of work in the future.

    I've seen too many projects with many hundreds and even thousands of repetitive lines of code, that could have been avoided if the author had spent a little time researching and learning..

  • So what's the problem? Why don't you use "Pick nearest" event?

    Player On collision with teleport

    Portal pick nearest to (Player.x,Player.y) -> Player set position to Portal

  • I would suggest making the game first, and then worry about hackers :)

    .

    For example, when you are close to releasing the game, you can copy the content of the file (made with Array Editor) and embed it into the code. This way it will be significantly harder for hackers to modify it.

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 257 followers

Connect with dop2000

Trophy Case

  • 8-Year Club
  • Entrepreneur Sold something in the asset store
  • 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
  • Forum Unicorn Made 10,000 posts in the forums
  • x5
    Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • 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
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x13
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

28/44
How to earn trophies