dop2000's Forum Posts

  • Check that you player's health and fullHealth are the same at the start of the game.

    Actually, you don't even need lerp (I like it so much I use it everywhere ), this formula is easier:

    bar.width=110 * (player.health/player.fullHealth)

  • You are testing line of sight for 3 instances at once, if any 2 of them have each other in sight, your condition will be true.

    If you need to test if left player instance sees another player instance, you need to pick left player first.

    But then your event "player has line of sight to player" will not work, because "player" now refers to only 1 picked instance.

    There is a workaround using a family, see this demo:

    https://www.dropbox.com/s/ey9ecnpwkuhco ... .capx?dl=0

  • Could you use a different file sharing service? I don't want to give them my email address.

  • I haven't tried this but I think this should work:

    For example your layout is 100.000px long and your screen size is 1024x768

    Make the first 1024px and the last 1024px of your layout look identical.

    Once the player.X>=(100000-1024/2), set its position to Player.X-(100000-1024)

    This should teleport it to the beginning of the layout

  • First of all, your link doesn't work.

    I've seen this tutorial before and frankly, I don't like it. I think it's overly complicated.

    Search for "inventory" on this page, there are lots of other tutorials which may work better for you:

    https://www.scirra.com/tutorials/all

  • You can use lerp function.

    Healthbar -> Set width to Lerp(0, 110, (player.currentHealth/player.maxHealth))

    So, for example if player.maxHealth=130 and currentHealth=65, then the healthbar.width will be set to 55px

  • TRMG

    I don't have any experience with Spriter either, but I did a little googling and found the feature called character maps. Are you using it?

    https://www.brashmonkey.com/spriter_man ... 20maps.htm

    It allows you to replace parts of your animation, for example change a helmet or weapon. If it can be done with one weapon, I'm guessing you can easily do the same with the second weapon in another hand.

  • I don't think there is an easy way to do it.

    I recently converted lots of global variables to local static and actually your post made me realize that some of them need to be reset when a new level starts. I had to create several events that reset them to 0 one by one.

  • Simple angle(player.x, player.y, bullet.x, bullet.y) should work.

  • mekonbekon

    Christmas

    Here is a new version. It doesn't need the Detector sprite anymore, works faster and spawns particles even when the asteroid sprite is located fully inside the ship sprite.

    https://www.dropbox.com/s/wko87enmiica2 ... .capx?dl=0

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Wow, that was the longest sentence I've read the whole week!

    So what's your question? You want us to create the game for you?

    This is not how this forum works. You need to read a few tutorials first and then start developing your game, and if you have a problem, you should try to fix it yourself, and if you can't fix it, try googling and reading more tutorials, and if that fails too, only then you post it here

    Also, your link is broken.

  • dop2000 - 25x25 is just where it starts to faulter. I'm really trying to aim for 100x100. Think of each pixel of the heightmap as a chunk of the map. The idea is to take every chunk and expand it into a second array so that chunk is in reality 100x100 tiles. I do realize this is an absurd amount of data. As far as reusing the array I could, but wouldn't that wind up in losing the processed data. I suppose I could dump it to json after ever single cell expansion of the main map. Would be a lot of files being created however.

    gskunk

    Still, why do you need to hold all 10.000 chunks of the map in full detail in memory at all times?

    Take Google Maps approach - it loads a portion of the map only when you zoom into it.

    You can load/generate a block of 3x3 chunks to allow players to move freely and load new chunks once they move to a new area.

    Also, how do you populate that second array? If it's randomly generated, you should use seeded random, this will allow you to store just one number in the first array (the seed) and you will not need the second array at all! You will be able to recreate the data in each chunk of map at any time from the seed.

    And if your player makes some changes on the map (kills enemies, opens chests etc.) and you need to keep track of these changes, maybe consider creating another array just for that. It could be something as simple as [tile, newdata].

    This will save you hundreds Mbytes of memory.

    EDIT: You can go even further and get rid of the first array too!

    Compress your entire 100 million tiles map into a single number - MasterSeed.

    Use MasterSeed and a pixel from your heightmap image to generate MapChunkSeed, then use MapChunkSeed to generate 100x100 tiles portion of the map. You probably should be able to do this in real-time with very little or no lag.

  • You can use "System->For Each Ordered" event (order by Family.y). Do what you need to do with that instance and then put Stop loop at the end, so it won't loop to the next instance.

  • Why do you need a 25x25 array for each cell of the first array? That's 625 values for a single pixel of your heightmap.

    And do you really need to keep all this data in memory at once? Can't you process one pixel at a time and re-use the same 25x25 array?

  • Your "attack" animation didn't work because it was immediately replaced with "idle" or "walk" animation.

    You need to modify your conditions like this: