R0J0hound's Forum Posts

  • Here's a few other miscellaneous experiments, some old, some new.

    https://www.dropbox.com/s/jnjcxc6hb8wu4 ... .capx?dl=1

    /examples28/boom.capx

    This is an attempt at a type of explosion. I was shooting for the look of a mortar explosion.

    No behaviors used. One interesting bit is I used a drag force on the particles that's based on their speed and size which allowed smaller particles to travel farther than the big ones which gave a nice effect.

    https://www.dropbox.com/s/36fg2ook2g085 ... .capx?dl=1

    /examples28/parser.capx

    A simplish calculator that parses and evaluates a typed equation. It tells you what's wrong if the equation is invalid. I never cleaned it up so it has a lot of debug stuff in it.

    https://www.dropbox.com/s/lchsartewcoo3 ... .capx?dl=1

    /examples28/event_physics3.capx

    An endeavor to implement physics for boxes without any behaviors. It's a constraint based solver based on some online guides. It's not perfect, but I learned a few things with it.

    https://www.dropbox.com/s/bhz8rpwuuq8j6 ... .capx?dl=1

    /examples28/voxel_isosurface.capx

    This generates a voxel isosurface that you can rotate a bit for a 3d illusion. There's some commented out stuff for other shapes but I never updated it to work right with the latest changes of the capx. Left click destroys it.

  • It could be webgl related perhaps? Not sure, I don't use webgl currently.

    It possibility could be that the timing of when c2's canvas is copied is when the canvas is between redraws when it's cleared? That's my only guess and it could be entirely wrong, also when I've looked into a solution in the past I've not had much success.

    A third possibility is no value is ready when invoking a download at that moment. Just a thought and since the built-in snapshot action has a "on canvas snapshot" condition, it may be a possibility. An idea could be to assign the last line of the script to a global var, and in events and then every tick check if the global is set before saving it.

    But taking a step back it may help to just use the snapshot action, since that is known to work.

    Here's how:

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

    use low quality fullscreen scaling

    set the canvas size

    zoom out the layout so the same stuff is seen.

    wait 0 so c2 has a chance to adjust the layout

    scroll to the center

    take snapshot.

    Then after the snapshot set everything back to what it was.

  • Edelplastic

    I think I didn't explain it well. Here is what all the parameters of the "draw line" action should be. I just used the standard names of objects to make it more clear.

    sprite.x-canvas.x

    sprite.y-canvas.y

    mouse.x-canvas.x

    mouse.y-canvas.y

    "rgb(0,0,0)"

    2

  • Edelplastic

    Positions are relative to the canvas itself. So you have to subtract the canvas' position.

    For example

    (sprite.x-canvas.x, sprite.y-canvas.y)

  • The same as above but instead of at the start of layout use every x seconds or something.

    To only have tiles near the player bubble, use the pick by comparison condition with the distance expression to only pick tiles in a radius from the player.

    You could also compare the x and y positions of the tiles to the edges of the screen.

    Like for x you could do the picking like this:

    X > viewleft

    X< viewright

    The same could be done for y.

    A third idea would be to have an invisible sprite pinned to the player and then only pick tiles overlapping that tile.

  • It depends how you have the grid.

    The easiest would be to have the red grids each be a separate sprite instance. Then you could give those squares a boolean instance variable "empty" with an initial value of true.

    As an example say you wanted to create 100 trees, you could do this:

    start of layout

    repeat 100 times

    redgrid is empty

    pick redgrid at random

    --- create tree at redgrid.x, redgrid.y

    --- redgrid: set empty to false

  • It should work on any html5 platform I imagine.

    The second will be garbage collected after that javascript is run, since nothing is referencing it at that point.

  • Yeah, it's the term used in physics math that tells how bouncy collisions will be.

    It's usually in the range of 0 to 1.

    0 is no bounce at all.

    1 is a perfect bounce. For example a ball dropped should bounce up to its original height.

    You can use value greater than 1 for stuff like a super ball or something.

    Another thing to keep in mind is the elasticity of both objects is taken to account for the collision.

  • This could do it.

    Start of layout

    For each block ordered by random(1) ascending

    System compare: loopindex<3

    --- wait 1.5*loopindex

    --- array set at loopindex to block.uid

    --- block flash for 1.5 seconds

  • I'd say it's not related to C2. If it happens reliably then by all means post a bug report, but getting keyboard input is a standard thing for software to do and they all do it the same way.

  • There's this one that's been up for a bit:

  • If you're willing to put in the time go for it. The file format changing a bit as c2 advances is inevitable, and if you're serious you'll have to somehow keep up as c2 gets updates. I highly doubt the file format would be changed just to counter a third party compiler, there's no point for that.

    Focus small first and see if you can convert over layouts with just sprite objects. I don't use unity, but if you're familiar how you work with their projects format I imagine you could probably get that working rather quickly.

    The events would be the next hurdle. Start by sticking with just the system and sprite events. To me this is much more complicated to do since users will expect things to work the same in unity as in c2. If it didn't it wouldn't be useful. The nuances of how events work would be the tricky bit there.

    Get to that point and you'll have most of the groundwork done. From there you can start working on all the other plugins and behaviors. That is probably what will eat up all your time, and that's the point where I dismiss my own idea of such a project.

    megatronix

    Wouldn't such a project be like native? Or do you mean creating an engine from scratch?

  • With the truck facing right the offset of the turret to the truck is (-13,-8).

    Then you can set the position with

    turret.x = truck.x -13*cos(360/72*truck.animationFrame)

    turret.y = truck.y -8 -13*ratio*sin(360/72*truck.animationFrame)

    Now "ratio" is the ratio from the visual height to the visual width of a isometric square. Depending on the angle of the isometric projection the ratio will be different. I was expecting 0.5, which is 26.5 for degree, but that didn't look right. So I measured the roof of the truck at 0 and 90 degrees. It was 8 pixels wide at 0 degrees and 22 pixels at 90, so the ratio is 8/22 or 0.36, so the angle is 20 degrees.

    So you could write it like this:

    turret.x = truck.x -13*cos(360/72*truck.animationFrame)

    turret.y = truck.y -8 -13*tan(20)*sin(360/72*truck.animationFrame)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think there has been a few topics about this sort of thing. Also this tutorial may be of use:

    https://www.scirra.com/tutorials/1447/u ... tial-games

  • Testing it in windows 7 it seems you can't run the exe if it's in certain locations.

    If I run:

    "c:\windows\notepad.exe"

    It works, but if I copy notepad to "c:\tmp" and try to run that:

    "c:\tmp\notepad.exe"

    It doesn't work.

    I'm guessing it may be some security block, but i'm not sure.