Lumicreative.com's Recent Forum Activity

  • Do you guys typically use one array to store one type of item such as weapons? Or do you stack multiple types all into one array such as weapons, inventory, tileset, powerups, etc...?

    If you do use one array, do you use a token to split between different types?

    Weapon 0 1 2 3 4 5 | Inventory 0 1 2 3 4 5 6 7 8 9 | tileset 0 1 2 3 4 5 6 etc...

  • oosyrag Ah, I see. It's just loading to array form ajax.lastData and then using the for each xyz element on the array to append to the global variable or text. Thanks!

  • oosyrag I usually do array load by doing, "AJAX.LastData". Since I am not loading any data through Ajax, what should I put instead of AJAX.LastData?

  • fr0z3n Awesome. hope it works.

    I would try this as well if it makes sense:

    node: Set d to distance(node.X,node.Y,Enemies.X,Enemies.Y)

    node: Set a to angle(node.X,node.Y,Enemies.X,Enemies.Y)

    node d<55: Move at angle: angle: 0.5*(55-self.d) distance: 0.5*(55-self.d)

  • fr0z3n Would it work to make the nodes move in realtime to avoid the defenders?

    BTW, my Beast Attack game is american football, but not in the traditional sense.

  • Is there a really clean and easy way to split ajax.lastdata to simple numbers in a global variable so that it looks like, "0,0,1,23,4"? Currently saving ajax.lastdata into a global variable looks like this, "{"c2array":true,"size":[7,2,1],"data":[[[1286],[885]],[[1605],[693]],[[1716],[903]],[[1643],[1033]],[[1842],[1015]],[[1940],[844]],[[1989],[974]]]}"

    What I'm actually trying to do:

    I'm saving all enemy positions (XY coordinates) into a json file. Then i'm loading that json file into a global var and using tokenat to retrieve the numbers to create enemies using those X,Y positions during loading of the level. Reason why I have it as a separate file is that I have separate json files for each level to build tilemaps, enemies, items, etc... This way, I don't have to have 100+ layouts to load each level - I can just load them on the same layout after each level.

    If there is a more efficient way to do this, please let me know!

  • I've decided that this method is useless for mobile. It takes nearly a whole minute to run through the loop. If I have more conditions and different objects, it would take a century to run it like this.

  • Magistross

    Yeah, realizing it freezes the game for 5 seconds while it runs through the loop. Figured out how to do it though:

    For "X" from 1 to 3000

    For "Y" from 1 to 3000

    If (Tile loopindex("X"), loopindex("Y")=8)

    Then Set tile loopindex("X"), loopindex("Y") to tile 19 Or create enemy

  • nimos100

    I think what I'm looking for is similar to ReflextionsDev. If I have a tilemap with grass, rocks, water and also have a tile that is the enemy, could I loop through the tilemap and look for all the tiles with the enemy and spawn my enemy object there?

    Reason why I don't just create enemies at X,Y coordinates is because I have the maps generated from JSON file and when creating a level, I can't see where I want to place my enemies (they might be in the walls). If I have a enemy tile, I can just draw my tilemap, export it, and load it in as a level in my game.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Is it possible to use two fingers to pinch and zoom within Construct 2? Or do I need an additional plugin?

    Spreading apart two fingers: Zoom in

    Spreading in two fingers: Zoom out

  • mattb this is pretty cool. Is the primary use for these to have other characters follow the player? What other potential uses do you see? Great work!

  • korbaach Oh my gosh! That worked! Why was I trying to be so complicated? I think because everything I researched was talking about arrays. Thank you!

Lumicreative.com's avatar

Lumicreative.com

Member since 20 Aug, 2013

Twitter
Lumicreative.com has 8 followers

Connect with Lumicreative.com

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • RTFM Read the fabulous manual
  • Email Verified

Progress

15/44
How to earn trophies