R0J0hound's Forum Posts

  • Here's an observation: Every time you destroy a tile another one needs to be created at the other end of the screen. You could store the array positions of each tile in the created tile's private variables, that would help in changing the tile. You could then do a loop to check to see if the tiles around the border of the screen exist, if they don't then create the object.

    Here is a different approach that recycles the tiles by moving them to the other side of the screen as they move off screen. This is done by having different tiles represented by different animation frames of one sprite.

    http://dl.dropbox.com/u/5426011/examples14/tilesFromArray.cap

  • #1 is just math.

    If the origin of your minimap sprite is at the top left then a mouse click can be converted to layout coordinates with these expressions:

    x:

    lerp(0,LayoutWidth, unlerp(minimap.X, minimap.X+minimap.Width, Mouse.X))

    y:

    lerp(0,LayoutHeight, unlerp(minimap.Y, minimap.Y+minimap.Height, Mouse.Y))

  • The "focus off" action is what's giving the trouble. A better way to remove focus is to give something else focus or destroy the object.

  • Have you tried the minimap object? It has a draw terrain action that uses the image of an object to draw.

  • Use a variable to store the state of each key you use and update them with keyboard and touch events. Then in the rest of your event just compare their value to see the state.

  • How about one key with an array.AsJSON saved into it, where the array has all the level info in it.

  • You could do lasers like this in post:

    http://www.scirra.com/forum/laser_topic44612_post279569.html#279569

    Make it work for multiple lasers by add a "for each laser" to the top of event two.

    You can adjust event two so that you get better performance by decreasing the repeat count and increasing the amount you lengthen the laser. It's just a balance between performance and accuracy, but also keep in mind that both numbers multiplied together also define the range of the laser. In the example the range is 30*20 or 600 pixels.

  • Here is the utility:

    http://dl.dropbox.com/u/5426011/utility/addobjfix.zip

    To use it put it in the same folder as your cap file and before you run it change this portion of the script:

    #------------------------
    #------------------------
    # change to your filename.
    filename='wewe1.cap'
    #------------------------
    #------------------------

    so that filename is your cap file and not 'wewe1.cap'.

  • There is no object limit, what you are expiriencing is a bug (did you copy objects from another cap?)

    I made a utility to fix caps that do that, I will find a link to it tommarow and post it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I was trying to make the text look like events. Sprite1 and Sprite2 are just the names of two different object types, and all I'm proposing is to add the objects to a family, add a family variable, and then for each object type set the family variable to the same value as the instance variable. At that time you can do the for each ordered solution with the family.

  • The simplest way would be to put the objects in a family and add a family instance variable z2. Then you could do this:

    every tick:

    sprite1: set z2 to self.z

    sprite2: set z2 to self.z

    for each family1 ordered by z2:

  • It's working here, I added more instances and they still worked as intended. If you create them at runtime you need to set the distort map size before displacement will work.

  • I'd try adding a "for each" condition to the end of event 220. If that doesn't work it's likely the else's that are causing all of them to be picked. In this case you can easily fix it by removing the elses and putting the inverted conditions of events 221 and 222 into event 223.

  • How's this?

    http://dl.dropbox.com/u/5426011/examples14/path.capx

    Of course you could simplify it by replacing event 2 with some events that just add/subtract from sprite.dist to move left/right on the path.