R0J0hound's Recent Forum Activity

  • According to this:

    http://www.hunlock.com/blogs/The_Complete_Javascript_Number_Reference

    All numbers in javascript are 64bit (or take 8 bytes).

    A megabyte is defined as 2^20 or 1048576 bytes.

    So you can calculate the memory used in megabytes with:

    100000 * 8 / (2^20) = 0.762939453125 mb

  • The solution I had in mind was proving to be too complicated, but here is another solution that doesn't use any third party plugins.

    http://dl.dropbox.com/u/5426011/examples16/inf_map3.capx

    The idea is save a bunch of random numbers in a big array at the start of the layout. Then using an formula like Array.At((x*23+y*5)%Array.Width) you can get a random number for any position on the layout. The 23 and 5 are arbitrary and can be any value.

    The main drawback is this method does create a pattern that is noticeable when the array is small.

  • With seeded random I can calculate the same value every time for a square so I don't have to store the random values in an array.

    For regular random you would need an array to store the random values to interpolate between. I've yet to work out how it would be implemented exactly.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • sqiddster

    A large array shouldn't be too much of a problem as most computers have a lot of memory.

    I tried out seeded random using the RandomPlus Plugin and here is the result:

    http://dl.dropbox.com/u/5426011/examples16/inf_map.capx

    If you're doing a scroller that goes in only on direction you could use the standard random, but store the values until they are no longer needed for interpolating.

  • Using a large array is an option, it will provide persistence. Shifting the array is another option but you won't be able to use for each xy element. You'll need to set the array in a certain order depending on which direction you shift. For example shifting right:

    for x from 32 to 0

    for y from 0 to 32

    -- set array(x,y) to array(x-1,y)

    A third option that would provide for persistence and and infinite size would be to use or implement a random function that allows you to set the seed.

    One example of this would be Perlin Noise

  • "unload layout textures" still works for images loaded at runtime, but the texture has to have no objects using it. If you loaded the images into a tiledbg instance, you need to destroy that instance before the image can be unloaded. If using sprites to store the loaded textures, then you will have to destroy all the instances of the sprite before it can be unloaded, or just load a small image into the frame you wish to remove.

  • cymrix

    It's a known issue with the canvas plugin. The plugin was originally made using just canvas2d (or no webgl). With webgl enabled every time the object draws, it's image is copied to a texture so it can be drawn, this is what causes the fps drop. The recommended solution is to set webgl to off.

  • That 2nd event is comparing carang1Stolen to choose(1,2,3), you need to set carang1Stolen to choose(1,2,3).

  • Those behaviors are family behaviors. If you select the ball family in the projects bar you can edit the behaviors.

  • 1. You'd have to test it and see, and then it would also depend on the device. Generally the size of the image doesn't affect speed. Image size does affect memory usage, and keep in mind that mobile devices have less memory than PCs.

    2. You can do that approach. Load the text file with the ajax object and utilize the System text expressions to read parts of the text.

  • It looks fine to me. What is not working, or rather what is happening?

    My only thought is perhaps an animation is causing another collision in a frame or two.

  • I can think of a few ways to do it. One would be to use the array object to store the list.

    Another idea would be to take advantage of object picking so that the picked objects would be the list.

    In a game of say Chess or Monopoly, every game position would be an instance of a sprite.

    Then the grand pseudo event could look like this:

    +Pick a piece

    +pick game_positions that piece can move to

    +not game_positions that already have a piece on them.

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 157 followers

Connect with R0J0hound