Arcticus's Forum Posts

  • Anyone got any ideas how to test to see if one angle is between two other arbitrary angles?

    You'd think it would easier than this :S

    stupid 180, -180 crossover....

  • That might help out, thanks.

    Basically I'm trying to tell construct which side of the square my player collides with so it knows the angle at which to bounce off. The squares will be different shapes, sizes and angles so i'm trying to develop a way of finding out regardless of these factors.

  • For an idea I'm trying out, I need to compare whether the angle between the player and the obstacle is between two other angles. For example:

    Is angle between player and obstacle within obstacle's angle + 45 and obstacle's angle - 45

    This sort of thing works fine and dandy if I use a perfect square at an angle of 0, but I want to use squares of varying widths and heights that also have an arbitrary angle.

    Finding the angles between each corner of the square i can do, it's the comparing of the angles that messes everything up, specifically, the 180 and -180 crossover point.

    Using the 'is greater than' and 'is less than' comparisons gets stuffed when the range you're comparing crosses over the 180 mark.

    Any help on resolving my issue?

  • Sounds really awesome

    But I certainly hope the 'create new animation angle of X degrees every X images' in the import screen can eventually get snuck in there too

  • Actually that's quite interesting, sparking off all manner of ideas in my mind as we speak.

    Although I'm hoping i don't have to have detectors everywhere.

    I have the code to find the correct bounce angle but finding the normal of the colliding wall was always the problem.

    One time I set up a complex loop that shot out detectors that stopped on overlapping solids then returned the average angle of a certain area infront of the player's direction of motion... but it didn't work out so well...

    I'm thinking now, I could probably use squares and circles to find the normal thingy, and to find which side of the square the player hits i could probably use an angle between points thing.... hmmmmm

    Is that what you did?

  • + On collision between Ship and Red Square

    -> Ship: set XMov to Ship('XMov') * -1

    -> Ship: set YMov to Ship('YMov') * -1

    The only problem with that, while it's the closest thing I can code for a custom engine bounce, it doesn't actually allow for realistic rebounds, it will ALWAYS rebound in the exact opposite direction at which you came at the obstacle.

    It's good enough for some things, but I would REALLY love a way to code in real bounces similar to the bounce object

    I want to put time manipulation stuff in my game, and either this bounce thing getting solved or scaling physics values to pixels per second will make what i need to do possible

    Just to clarify, say in my super speed demo i posted ages ago, you slow down time say, a thousand times slower, that would mean you have to make the player object move 1000 times faster to make it look as though the player's speed isn't affected. In a custom engine I can do this no sweat, but the player doesn't bounce properly, but if i'm using the physics object, the player bounces perfectly fine, but when i use the code to make the player speed up the same ratio that time has slowed down, he doesn't go the right speed at all

    it's like:

    Custom engine: speed = 200, times that by 1000, new speed would be 200000 pixels per second

    Physics engine: speed = 200, times by 1000, physics value still listed as 200000 but travels at what appears to be a lot slower than what it should be. The value of the velocity has no doubt been multiplied by 1000, but it's like the velocity in physics uses a different ratio or something. Almost as if 400 velocity is NOT twice as fast as 200, if you get my drift. Correct me if i'm wrong

    sorry bout the wall

  • that's really cool, reminds me of elite 2

    Needs some work but awesome cool

  • I have jump on enemy code? Heheh, well if i made an example a while ago it was hypothetical but i can only imagine i would do it similar to how i did it in the cap up there ^^^

    Did you want the player to lock on to the enemy's position or not? cause then you would probably have to have 2 variables for the player that store the enemy's X and Y components and then make it so when the player is on the enemy, change his X and Y comp's to the enemy's ones stored in the private variables.

    If you really want i could try and make something

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Actually, I may have just fixed it :O

    Once again due to my own sloppy code

  • Well it may not actually be broken, but in my iso game engine, i can't seem to get jumping on top of things working properly, mostly cause they have to use the overlapping condition. I think i made a thread about it a while ago but nobody responded

    It's probably my code (sorry to OP for hijacking post )

    Anything wrong with these events?

    I've tried doing things like a 'for each terrain' etc, but basically, whatever my code, if it has an overlapping statement in it, when the player's 'footprint' is overlapping two or more collision detectors, sometimes it acts oddly, like the way i've coded it (i hope) it's supposed to pick the object with the highest height variable and then the new 'ground level' becomes that of the highest one that the player is higher than. But sometimes the new ground level won't be updated until the player STOPS overlapping the shorter obstacles, resulting in enabling the player to be able to jump inside larger obstacles. I thought it was a picking error that had something to do with the order that the obstacles were created but i could be wrong.

    I'll post the cap again i suppose, it's been updated a little anyway

    http://www.mediafire.com/?wzhrxggjnew

    Anyways, to avoid further hijacking of the OP's post you could PM me or I could start another thread or you might be able to find the old thread i made

    Thanks

  • albeit with a broken overlap system.

    Does that mean it's getting updated?!

  • Pretty much all my movements are custom movements.

    Whenever I'm doing gravity, I do something like this:

    Player.Y = Player.Y + Player.Value('Gravity') * timedelta

    I also have a detector that determines the 'Ground Level' of the player that is always on the ground

    And then I have a variable that determines whether he's jumping or not, ie: Jumping = 1

    When Jumping = 1, on a trigger once subevent, i set the gravity variable to something like -200 and on the main event i have something like this: add 100 * timedelta to Player.Value('Gravity')

    Then once the player's Y coordinate is greater than the ground level detector, simply turn jumping to 0 and set gravity to 0, then if there's any loop that pushes him out of the ground now would be the time to use it. Although I suppose it's entirely possible to code without the ground detector... I really only use the ground detector in Iso type games as there technically is no ground, in platform you could just use an overlapping event

    Also you're probably going to need two variables for X and Y movement, i usually just called them Xcomp and Ycomp.

    Then it's simply always: set player X to player.X plus Player.Value('Xcomp') * timedelta

    set Player Y to Player.Y + Player.Value('Ycomp') * timedelta

    and i suppose for a platform game, you don't really need all that gravity i just mentioned cause you could treat the Ycomp variable as gravity..... oops, in which case you could just do something like: If player is not overlapping solid, add 200 * timedelta to Player.Value Ycomp

    I hope that helps and I hope I've been concise enough with my description.

    Need any more help I'll try and help

  • Ok so perhaps it was poor coding on my part

    I haven't been able to reproduce what happened before

    nevermind

  • While we're on the subject of events, does the OR system condition work properly? Methinks it doesn't

  • If you want I could post the code that i made, I've posted it here numerous times though, I'm having problems with picking with 'is overlapping' though. I've pretty much got the jumping on top of things down, it's just with some collisions it doesn't work so well due to a picking error