R0J0hound's Forum Posts

  • Search for "worms" there is an example that uses the canvas plugin to do destructible terrain.

    Another idea would be to set the bottom layer as transparent "use webgl" off, and "clear background" as no. That way anything that is drawn stays there until it's overdrawn. Then you could draw the terrain, and only redraw the parts where stuff is moving/changing. You can store the entire terrain in an array and juggle a small amount of blocks to do the drawing. So at any given time you'd have only say 100 objects being drawn per frame but you would see 1000s on screen.

  • InvaderX

    Look at the example again, you need to make events 47-50 sub-events of 46.

    Also the order of the actions is important. It should be like this:

    Dictionary: clear

    ..

    Dictionary: add key...

    ..

    StorageGame: set value at index to Dictionary.AsJSON

    System: add 1 to index

  • I've done this before and it works pretty well.

    As soon as you jump start ignoring input and set deceleration to 0.

    Then when the player lands stop ignoring input and set deceleration to what it was before.

  • InvaderX

    Check the example on that other topic.

  • I'd say he meant difficult. You have to explicitly specify all the info you want to save.

    Here is one idea:

    http://dl.dropbox.com/u/5426011/examples13/save_load.capx

    I use the dictionary object to store the named values for each object. I then insert dictionary.AsJSON into the array for each object. The array now is a snapshot of what I want to save. It is then trivial to save to webstorage with the action:

    webstorage: set local key "game_save" to Array.AsJSON

  • I'd say tokenat() is the bottleneck here.

    I replicated your example but used a 610k text file of the english dictionary (60387 words). It was dog slow. I stopped it after 10 seconds and it only had read 1400 words.

    So I modified it and used mid() and find() to progressively get the words.

    http://dl.dropbox.com/u/5426011/examples13/dict.capx

    It read the entire thing in 0.979 seconds.

    Then for the fastest possible performance I modified the example above to save the Array to a JSON file. Then I made another capx to load it with the load from JSON action.

    http://dl.dropbox.com/u/5426011/examples13/dict_json.capx

    The data file is now 905k but loads in 0.039 seconds.

  • The platform behavior prevents any overlap with "Solid" objects. When the "on collision" event is run the objects are not overlapping so the actions are never run.

  • The feature already exists, but it is not available for the free version.

    http://www.scirra.com/store/construct-2

    At least I think that's what "Project Folders" means. Try right clicking in the objects bar and see if a "add subfolder" option is there.

  • Glad it was useful. You can reduce you event count to 2 by putting all the objects you want to wrap into a family.

    I'm curious about the changes to the formulas, namely this:

    LayoutWidth-LayoutWidth

    Couldn't you just use 0 since it will evaluate to 0 no matter the value of LayoutWidth.

  • Perhaps the warp behavior does something similar to what you tried with events.

    Do it with these two events instead:

    X > LayoutWidth+self.Width/2

    set X to self.X-LayoutWidth-self.Width

    X < -self.Width/2

    set X to self.X+LayoutWidth+self.Width

  • Here's one idea:

    http://dl.dropbox.com/u/5426011/examples13/multi_inv.cap

    Basically the bags are in a container with an array, so each bag has an array for it's contents. When the player touches a bag the bag's inventory is displayed. The player's inventory is handled the same as the bags, except there is no array for the player's inventory, just the slots. One could be made later if needed.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The increasing ram usage is caused when using webgl. Internally the plugin still uses canvas2d and with webgl a new texture of the canvas is made every frame causing the memory leak. I need to re-write it properly use webgl in an efficient manner.

  • Re-download the example, I made it a bit more generic.

  • t will work on spawning objects too, right?

    I don't quite get what you're asking. Event 2 does the creation and positioning of the smaller objects. You can put it anywhere in your events where you want to create/spawn the small boxes on the big box.