tunepunk's Forum Posts

  • R0J0hound

    There seem to be something wrong. Any idea what it can be? very wide angles tend to be wrong.

  • R0J0hound

    Everything worked perfectly except a small thing.

    angle(0,0,cos(Trace.NormalAngle), sin(Trace.NormalAngle)*2) was supposed to have /2 instead and all worked like a charm.

    Thanks a bunch!

  • alextro Yeah i got that far, but my main problem was calculating the normal vector between two angles (in and out). It's too bad you can't access the collision box angles, directly with events. That would help a lot.

  • R0J0hound Thanks for the detailed explanation. I will try that out, and see how it works.

    I just tried a different approach where the jcw_trace plugin can give me both the normal angle and reflection angle directly without having to fire a bullet and rely on the angle it bounces off. The only problem with the values i get from this plugin is that they are in normal 2D mode.

    using the atan(tan(oldAngle)/2) formula on the normal vector i get there behaves strange as i have to flip it.

    if the normal angle is between 90 and 270 i have to add +180 at the end of the formula, otherwize that formula behaves strangely.

    So with this raycast plugin giving me both normal and reflection(exit) angle, is there a better formula to derectly adjust the exit angle for isometric based on values i can get from this plugin?

    seems better than using a bullet, in this case. Thanks a lot for your help.

  • I seem to be getting closer but i get some weird results again when i try to get the average angle between two angles... Does anyone know how to properly calculate the average angle between 2 angles that takes on to account wrap around?

    what's the angle between 350 and 20?

    I know it could either be 185 or 5, but i always need the closest one.

    What's the correct formula to use to always get the closest angle between to two?

  • Hmmmm..... Just speculating here........

    the normal vector must be entryAngle+exitAngle/2

    Entry angle (225)+ Exit angle (315) /2 = 270 makes sense. That's the normal vector.

    Exit angle = (NormalVector (270)-Entry angle (225) = 45 + Normal Vector ( 315) ... seems correct.

    Soooo .... i need to adjust that Normal vector to get a correct exit angle? atan(tan(oldAngle)/2)

    hmmmmm so basically i need to adjust any vector angle as if it was not in isometric.

  • TELLES0808 Thanks for the example. Adding the difference makes sense but how do i calculate the difference? My main problem is that my isometric objects can have any shape or angle. Everything is not diamond shaped. The formula i found didn't work at all in my case. I was getting weird angles when hitting any other angle that was not "diamond shaped".

    This is what I'm after.

    I need some kind of formula that adjusts the exit angle for any object shape. or any normal vector angle hit.

    EDIT: I can't apply "atan(tan(oldAngle)/2)" directly to the exit angle. It creates weird results. I suppose that formula should be used to the normal vector hit. But since i can't adjust that, I need to adjust that exit angle AS IF it hit an angle adjusted by that formula i suppose?

    EDIT2: Is there any way i can get the normal vector by using entry angle and exit angle? adjust that normal vector with the formula, then calculate a new exit angle based on ently angle and the new adjusted normal vector?

  • Think I found the answer after a bit of intensive googling.

    isometricAngle = arctan( tan(oldangle) / 2

    Will try it out when I get back home. Replacing the angle of motion after bounce with the result i get after using this formula.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It seems that the only way to solve this would be to use the movement angle of the bullet before the bounce, and as soon as the bounce happens (when the bullet has a new angle of motion) adjust that angle the next tick, based on some formula, but how to get there I don't know.

    EDIT: Keep in mind, the bullet can hit from any angle, and the obsatcle can be any angle. I even have some round-ish solids.

  • I wanted to have projectiles bounce of solids in isometric view, but everything seems to bounce off in a very weird way. Like shown below. (Green is the observed result which makes sense in a top view, if the obstacle had that shape)

    Is there any way to adjust the bounce of a bullet to behave more natural in isometric view, and is there any formula for that.

    Bullet behaviour has the "bounce of solids setting" which only seem to work in pure 2d scenarios.

    Is there any way to solve this? Been scratching my head a while with this one.

    There doesn't seem to be any way to get the angle of the side of the collision box hit either.

    Any help appreciated.

  • IN case you missed the edit:

    Otherwize you can use the choose instead.

    choose(1,2,3,4,5,6,7,8,9) or how many parameters you want. it will pick a random one of those.

  • I'm not really sure i understood, but you could try something like this.

    if you only want integers returned you can use round, floor, or ceil.

    round(random(1,10)) will give you integers between 1 and 10

    floor(random(1,10)) will give you integers but rounded down. 2.5 will be 2

    ceil(random(1,10)) will give you integers but rounded up 2.5 will be 3

    Was that what you were looking for?

    Otherwize you can use the choose instead.

    choose(1,2,3,4,5,6,7,8,9) or how many parameters you want. it will pick a random one of those.

  • Why don't you put the tilemap for you character on a new layer, then rotate the layer? Maybe that could work?

  • Pretty nice game concept you have there. Played it completely through. I hope you add more levels later!

  • I guess he means that the source of the game code will be freely available. Like sharing the capx?

    If that's the case i doubt it would be any problem, as anyone who want's to edit the game code (capx) needs to have their own license?