R0J0hound's Recent Forum Activity

  • In the exported folder there is a debug.log file. Does it have any errors?

  • It isn't really reasonable to want an answer within a half hour. Your question isn't clear, do you mean you want to get the speed of an object? You can calculate it with the Pythagorean theorem and the x and y velocities. Maybe this topic may help:

  • Ok, here's a python version.

    https://www.dropbox.com/s/73o1wa4ts21uf ... y.cap?dl=1

    /examples31/saveLoadpy.cap

    The first script under the "start of layout" is the meat of it. It has two functions to save/load to a json file.

    The first function is save. As an example it can be used like this:

    save("myfile.txt", Sprite, Sprite2, Family3, tiledBackground)

    Basically the first parameter is the filename and you add the object types you want to save as the following parameters. You can use as many types as you need. Sprites, tiledbackgrounds and families of either should work.

    Load is simpler, you just use a filename as a parameter. For example:

    load("myfile.txt")

    Other nice to knows:

    The file is saved in the working directory i think but if you want it to be saved to the apppath use:

    System.AppPath+"myfile.txt"

    If you want to only save the picked objects use SOL.Sprite instead of Sprite.

    Saving tiledbackground's instance variables will crash so it's not done.

    Finally there isn't a way to find out what an object's collision mode is in events so it can't be done in python.

  • You can access the picked objects using the SOL object.

    So say the object name is "sprite", then in Python you would loop over the picked sprites with:

    for obj in SOL.sprite:

    obj.x=2

    There are some older posts with more details about Python that may also help. Anything accessible with events is accessible from Python, well except many conditions such as triggers can't be used in Python but that's about it.

    Give me a day or so and I'll wip up an example.

  • Both are the same. To be able to draw the image it has to be in memory.

  • You mean will it make your game run faster? The most it would do is make the game download quicker if the file size is smaller. The speed of uncompressing might change but it doesn't matter since it's only done once and is not a bottleneck at all.

  • you could use a global variable and a loop. something like:

    every tick

    --- set global 'anykeydown' to 0

    for "" from 0 to 255

    key loopindex is down?

    --- set global 'anykeydown' to 1

    global 'anykeydown' equal to 0

    --- do stuff

  • Hi,

    I know this doesn't answer your question directly but I've found it's tricky to get that working good with collisions.

    One idea i've tried before that works well is to instead just keep track of how far each block should move.

    https://dl.dropboxusercontent.com/u/542 ... _drop.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you want to create them every tick, you'll probably wan to destroy them all every tick first. You can also change the loops to go from -2 to 2 instead.

  • No problem. It was fun to make.

  • You can create objects in a formation by using two loops

    start of layout
    for "x" from 0 to 3
    for "y" from 0 to 3
    --- create sprite at (loopindex("x")*32, loopindex("y")*32) [/code:egxi6tbt]
    
    You can control where the topleft of the formation is by adding it in so say you wanted the top left to be (100,150) you could use (loopindex("x")*32+100, loopindex("y")*32+150).
    
    you can also make the formation get created around a center.
    [code:egxi6tbt]
    global number rows=4
    global number cols=4
    global number centerx=100
    global number centery=150
    
    start of layout
    for "x" from 0 to cols-1
    for "y" from 0 to rows-1
    --- create sprite at ((loopindex("x")-(cols-1)/2)*32, (loopindex("y")-(rows-1)/2)*32) [/code:egxi6tbt]
    
    As a final example you can store the row, column in the sprite itself and do this:
    [code:egxi6tbt]
    global number rows=4
    global number columns=4
    global number centerx=100
    global number centery=150
    global number offsetx=0
    global number offsety=0
    
    start of layout
    --- sprite: destroy
    --- set offsetx to (columns-1)/2
    --- set offsety to (rows-1)/2
    
    start of layout
    for "x" from 0 to columns-1
    for "y" from 0 to rows-1
    --- create sprite at (0,0)
    --- sprite: set column to loopindex("x")
    --- sprite: set row to loopindex("y")
    
    every tick
    --- sprite: set x to centerx-offsetx+self.column*32
    --- sprite: set y to centery-offsety+self.row*32
    [/code:egxi6tbt]
    That way you can move it around by changing the center.
  • To add the newt's reply, there's the "load" action to load a json. Also there's the Tilemap.TilesJSON to get the json.