oosyrag's Forum Posts

  • You don't want to add anything to loopindex, as it correlates to your array x index. If you want to set data for your second row, you need to add an action set array at x y, where x is loopindex and y is 1.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ahhh I see.

    I'm not very familiar with XML myself, so someone else may be able to give better input.

    I think the structure of an XML file generally lends itself to describing nested data rather than a spreadsheet like array. It would be more like an object and its instance variables. For an array, it may be better to use a spreadsheet saved as a .csv.

    You also mentioned procedural generation, so wouldn't your array be generated in game? In that case, you can simply save your arrays as JSON, and load that straight back into your array. No need for XML.

  • How is your xml and array arranged? What do you want to load into your array?

    To parse a project file, you will need to request it with AJAX. Then On AJAX completed, you will have access to the contents in AJAX.LastData.

    You can use tokenat or the XML object to pull out whatever relevant information you want to put into an array however you want or into any other data structure.

  • My first attempt: https://www.dropbox.com/s/bwtrse3v6wmth ... .capx?dl=0

    Really clunky but I think it works in all situations. Now to start over with a new approach to try to figure out a cleaner method like yours T_T

    If I run a function like this that destroys and recreates the triangles every tick rather than resizing them, will run into performance issues? Will the UID numbers overflow eventually? Especially if I have a significant and variable amount of them at any given time, such as for the line of sight application.

    I'm figuring drawing triangles with html5's own draw functions would be the most efficient method. Hoping Paster handles the bounding box, collision box, and transparent areas suitably for the purpose of blending modes. I'll experiment a bit with that next.

  • Not exactly what you ate asking for, but generally speaking the better approach world be to "move" the weapon with animation frames rather than fiddle with it's actual position and angle.

    But to solve your problem, set the new position AFTER your every tick event. Remember events run in order from top to bottom, so if you change the position before, the every tick event will just put it back to where it was before.

  • In a very basic sense, everything boils down to object count for the cpu. Animations are objects, particles are objects. It looks like your phone is starting to struggle with 10k objects, although 40+ fps is still rather passable. So try to avoid going over that.

  • Depends on your cpu.

    http://www.scirra.com/labs/particlesperf/

  • Ah... not sure then. I believe there are some Pin examples when you go to "New Project" in the menu.

  • Suggestion - Add a disclaimer to the Wait tutorial that mentions it is a very special action that completely breaks from how the event sheet system normally works.

    I'd even want to suggest it should probably be something for beginners to avoid, as it seems to be subject to a fair amount of misuse (most commonly in loops). Or maybe make a mention of it in the common mis-used events and gotchas article?

  • You want to use loops to dynamically create and place your grid of sprites, and at the same time you will use the loopindex both for placement and for setting the correct animation frame.

    For example, for 80 sprites, and you want to create a grid of 8x10

    For "x" from 1 to 8

    (subevent) For "y" from 1 to 10

    Create sprite at loopindex("x")*sprite.width, loopindex("y")*sprite.height

    Set sprite animation frame to 10*(loopindex("x")-1)+loopindex("y")

    EDIT: Alternatively, if you have only as many of your sprite on your layout as you have images, you can do a for each sprite, set sprite animation frame to sprite.iid. This may not work correctly if you don't have the same number of sprites as animation frames.

  • In a traditional snake game, the segments of the snake actually don't move at all. The "head" piece leaves "body" segments behind as it moves, and the duration the "body" segment exists for determines the length of the snake.

    Otherwise, you'll want to look into using waypoints system with an array.

  • plinkie means post a .capx file - your project save file, so that we can look at it and see what is wrong. Basically, there is no reason it shouldn't work, like in an example I made previously here. https://www.dropbox.com/s/dkqrwnwdz75qh ... .capx?dl=0

    The guess is that your player is stuck on a solid sprite, which could interfere with the 8direction movement. It may be invisible, but still solid.

  • Is this what you're looking for? https://www.dropbox.com/s/s7i5gp9zc9fzt ... .capx?dl=0

    And this one I made based on R0J0's first post before I read more carefully and realized it wasn't what you're looking for, but I'll leave it here anyway - https://www.dropbox.com/s/u7ktol9qyy166 ... .capx?dl=0

  • I'm not sure without looking at it, but you might have gotten your numbers reversed. Remember a scale factor less than 1 would be zooming "out" and a number greater than 1 would be zooming "in".

  • Actually clamp() would be more suitable, to set a min and a max.

    In the previously mentioned example capx, the zoom amount is set with the action

    Set Layout Scale to InitialScale * (TouchCurrentDistance / TouchStartDistance)

    You would instead set it to clamp(InitialScale * (TouchCurrentDistance / TouchStartDistance),minscalefactor,maxscalefactor)

    Where min and max scalefactor would be the limits of how much you want to zoom.