dop2000's Forum Posts

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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

  • 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:

  • Use modulo (remainder) operator - %

    x%2 will give you either 0 or 1

  • [quote:33z4b3e6]If slider goes up by x > make other variable value go up/down by x

    You can get the slider value at any time with the expression SliderBar.value

    I'm using it in my demo to output temperature as text, you can assign it to a variable or use in formula.

  • Just change the Preview Browser to Firefox then. It's in project properties.

  • Here is the file for version 244:

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

    You can change the browser used for preview in project properties. If it doesn't work in chrome, try another browser.

  • You can add a condition, something like this:

    System->Compare two values-> Distance(player.x, player.y, enemy.x, enemy.y)<500

    then move enemy towards the player.

    It's not specific to 8Direction behavior. You can compare distance or angle between two objects and execute different actions.

    Have you checked the Tutorials section and FAQ? I'm sure you can find many examples on how to do such things.

    https://www.scirra.com/tutorials

    how-do-i-frequently-asked-questions_t63692

    And here is someone else's game that uses similar mechanics - when player gets close to bees, they start moving towards him and attacking, but once they get too close, they stop. It's not a very good code, but it does what you want.

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

  • Not sure I understand your question.

    I made a little demo, hope it helps.

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