R0J0hound's Recent Forum Activity

  • Increase the friction value on the boxes and the floor.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • "svchost.exe" is a part of windows that runs services. Services are things that runs in the background, the audio playback service, printer service, networking service, etc... Basically it's mainly essential windows stuff plus services added by other software.

    Html will never deal with that file, and in fact cannot access it in most browsers, let alone with javascript. But that isn't javascript, it's vbscript which is a windows thing.

    Anyways C2 does not generate that stuff in it's exported html, which means something on your pc is putting that in the file. It's probably a virus/tojan/spyware/etc of some kind infecting your pc. That html probably tries to run something on your computer that's encoded in that hexadecimal string. Good news is it probably only does something if run from iexporer. Well, if you can call that good news.

    Your solution is to get an antivirus to clean your computer, and/or have someone tech savy that you know help you.

  • The bullet behavior has a property "set angle", set that to "no" and the rotate behavior won't change the angle of the bullet's motion.

  • totoyan

    You probably should create a new topic for the issue. This topic is for Construct Classic, not Construct2. That said if you exported game is getting that in it then something is amiss with your system since C2 never creates code like that.

    Look into getting a antivirus or other such software to clean your system, if the exported html gets that in it then something infecting your pc is putting it there.

  • Use the rotate behavior.

  • C2 considers a sprite mirrored if it's width is negative, so you could use (sprite.width<0) in your expressions to see if it is mirrored.

  • Hmm, I seemed to have missed your last reply.

    The math is the capx is simplified for just horizontal ground. The first step would be to make it work with any angle. Actually you can do this by taking the velocity and using a dot product with the angle of the surface to get perpendicular and parallel velocities that can be plugged into the equations already there. That covers getting the bounce math to work.

    Next the collision detection and resolution would need an overhaul. This is what keeps the football from falling through the floor at low speeds and lets us know when to bounce. It is also what gives us the point of collision. Right now we have oval vs horizontal line working. New would be oval vs any line. The math there isn't too pretty which explains why ovals aren't usually a common shape in physics libraries. Also you'll need to work out the formulas. Either that or use the iterative approach.

    Ok, next we need oval vs oval collision detection. The simplest solution is to convert the oval to a polygon first. Then you'd take the two ovals and see if they overlap. If they do we need to separate them till they collide at only one point. The two ways to do this is to either move backward in time to they just touch, or use something like SAT or GJK/EPA to move them apart.

    That just covers the simple case of only one moving oval and everything else is static. For collisions between two moving objects the bounce math now needs to use the relative velocity (Va-Vb) between the two objects instead of just the velocity of one. Otherwise the stuff above is more or less the same.

    One caveat is when there are multiple objects that need to be pushed out of each other, then correcting one pair can push them into other objects. This is usually solved by repeating this check multiple times to reduce the amount of objects overlapping. You'll also want to make collisions faster by checking if the object's bounding box is overlapping first, before the other more costly oval-oval collision check.

    In summery you will be creating a full blown physics engine. I have roughly outlined one approach, but there are many tweaks that improve speed and accuracy.

  • Also from those expressions you can get the total speed with:

    distance(0, 0, sprite.physics.velocityx, sprite.physics.velocityy)

    You'll need to use system->compare or system->"pick by comparison" to compare it.

  • Run it with the debugger and look at the object counts, they are increasing constantly. You need to move the events that create them to be a sub-event of start of layout.

  • One way to do it is with the overlapping at offset condition. So say the ai sprite's size is 32x32 you could do this:

    [inverted] ai is overlapping ground at offset (-32,32)

    --- ai set angle to 0

    [inverted] ai is overlapping ground at offset (32,32)

    --- ai set angle to 180

  • jogosgratispro

    For a 10x2 array for example, you'd have to swap around not only array.at(curX), but the other values too. But no matter, just use the sort action and don't worry about it.

  • I don't think you need to worry about this. Loading of arrays, even gigantic ones, is negligible, and even then it's only done once. When it comes to arrays the only way it would slow things down is maybe if it's enormous (millions of values or something) and your events loop over it every tick.