R0J0hound's Forum Posts

  • Angles in c2 and most places in graphics are clockwise from the right. Anyway the idea is the same, just change the values. Just change 270 to 90 and ang to -ang.

  • The offset in overlaps at offset is as if the sprite was moved by that amount before checking for collision.

    Anyways the typical solution is to use detector sprites at the front and back of the tank. You position the detectors and then move them up or down till they touch the ground, then the angle between the two is the angle to make the tank.

    Here's one possible solution:

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

    And here's another that samples more points.

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • [quote:1hms37qb]ViewportBottom(layer)

    ViewportLeft(layer)

    ViewportRight(layer)

    ViewportTop(layer)

    Return the viewport boundaries in layout co-ordinates of a given layer. Not all layers have the same viewport if they are parallaxed, scaled or rotated separately.

  • You could make two sets of the spritefont. One with the outline and one with just a solid colored inside. The inside ones you could put on it's own layer with a gradient sprite that uses a blend mode. Also be sure that layer has force own texture.

  • maybe:

    global number rotateDir = 1

    global number ang = 0

    space is down

    --- add 100*rotateDir*dt to ang

    --- sprite: set angle to ang

    ang>270

    --- set rotateDir to -1

    ang<0

    --- set rotateDir to 1

  • Mayfly

    This is actually a very difficult thing to do.

    Looks like the only js library that can do it is this:

    http://excelbuilderjs.com/

    Here's an example of it's use from C2 with the browser object.

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

    /examples35/excel.capx

    First it loads the needed libraries and call the "ready" function when it's done.

    Next it creates the workbook, worksheet and populates it from a 2d javascript array.

    Then to get a image to save it snapshots the canvas. You could use the canvas object to get image data as well.

    Finally it generates the file and uses the browser object to download it.

    It basically follows the examples on their site and at the very least gives you a starting point to play around with. Also I won't be making a plugin for this.

  • Ciao121

    You unzip the file into the effects folder in C2's install directory and then it's as easy as using any other effect.

  • You need a layer per fov. Each layer needs to have "force own texture", and it's own light and cone sprite.

  • Nothing comes to mind. I know the editor can have an issue if you have a huge amount of object types. Well, it's actually a Windows issue that limits the number of icons. Still there's a setting in C2 to fix this, and considering CC is probably subject to the same limit then this is a non issue for you.

  • Well I was bored and had a quick look through C2's js files. Creating and destroying seems straightforward but it gets more complex dealing with global objects and global layers.

    Are you using any global layers? my best guess is the issue may be with that somehow in conjunction with saving/loading. I'm just speculating though based on what you've said.

    Being that it isn't reproducible it's not really something that can be reported to the bugs forum. Still I'll tag Ashley to at the very least get the issue at the back of his mind.

  • Gutogordo

    The clear canvas action?

  • Interesting. Well I'm pretty sure the assignment of uids is done in only one spot in the runtime and that's when an object is created. Other than that the uid isn't modified anywhere except maybe the save/load code.

    If I'm bored over the weekend I might poke around the js files and see what there's to see.

  • That should never happen. It's a bug if it happens with vanilla c2 features. Are you using any third party plugins, and if so which ones?

    Edit:

    Not that there have been any plugins that cause this that I know of. The idea is to isolate what is causing the issue. If it is happening reliably then you can make a copy of your capx and start removing stuff till you have a minimal capx that still causes it.

  • I found the angle here based on the closest edge or point on the collision polygon, but then if you have that then shooting a ray is excessive. In short even though I thought it over casting rays isn't useful to solve the problem. The most I can think of is to shoot a bunch of rays out and picking the closest one, but that is imperfect.

    The sliding is done by correcting the overlap oppiset the angle chosen and the canceling the velocity going in the direction of the angle. That can be done by utilizing a dot product.

    The algorithm I used can be made faster by not checking far away objects and/or implementing it in JavaScript. A plugin may be ideal but to me that's a pain to make and maintain.