R0J0hound's Recent Forum Activity

  • A few thoughts:

    * there are conditions to compare angles. I’d recommend using them instead of the “value is between values” condition because they handle how angles can wrap around from 360 to 0.

    Another way is to take the angle and calculate a variable for the quadrant number. 1 to 4.

    Quadrant = (round(angle(sprite1.x, sprite1.y, sprite2.x, sprite2.y)/90)+4)%4+1

  • Here’s a few ideas:

    Speed up

    Speed = speed + acceleration*dt

    Slow down

    Speed = speed - deceleration*dt

    Also speed*0.5 is the same as lerp(speed, 0, 0.5)

    So supposedly the way to make that use dt is lerp(speed, 0, 1-0.5*dt) but you’d probably have to tweak the 0.5 value.

    So you’d utilize that idea whenever you’re using a scaled value of speed.

    That should mostly make things consistent. It will still vary a bit at different frame rates though. Sometimes you can throw more math at it in some cases to improve it. Easiest way to make completely deterministic physics is to run at a fixed frame rate but construct doesn’t provide a way to do that.

  • Yeah that condition just evaluates normal math expressions not an expression in a string.

    I think any non empty string besides “0” will be true.

    To evaluate an expression in a string you have some options:

    One way is to write a text parser to extract the operators and numbers and evaluate the expression. That would give you the most control over how it’s done.

    A second way is to use the browser objects execjs expression. It’s basically the eval function js has. It can’t reference variables though.

    Third option would be to find a plugin that evaluates text expressions. I’m sure someone made one before.

  • Simplest is just setting the collision polygon to the shape. In the image editor you can even right click and have it guess the a polygon from the image, but you may need to tweak it.

    The benefit of using a collision polygon is that interacts with the behaviors and collision events.

    The con is it’ll only be as smooth as you make it. So more points on the polygon. Then the smoothness is also reliant on the behaviors collision response, but I imagine it would be ok.

    You can roll you own collision detection and response and represent that shape more perfectly with a completely smooth ramp but it takes more math and some fiddling to setup. And the main con is behaviors won’t be able to interact with that. But it does give you more control over how it works.

  • Yeah that’s how I do it. I’m not sure how to do it otherwise.

  • Basically by not defined I mean having an else after a loop makes no sense to me. When does the else run? When the loop ends?

    Guess you’ll probably want to break it up into chunks to test and verify it’s doing what you are thinking it’s doing and then adjust accordingly.

  • Honestly best you can easily do is add the tint effect to a layer where the particles are. Gotta work within free limits.

    Another idea to explore is a layer with a colored background and the particles with blend modes. But that honestly probably won’t work the same.

    If the particles object lets you load an image at runtime you could use js to modify the pixels of an image and load that. But you’d need to make a plug-in or do something hacky with the browser execjs action to do that. More trouble than it’s worth maybe.

    You could make a plug-in but construct’s renderer doesn’t provide a way to tint a texture. In theory you could hack the renderer to run arbitrary shaders there. But that’s absolutely not worth the trouble. We just wanted to tint an image, not redesign the entire engine renderer.

    Anyways you could probably try the first two. This was meant to give ideas to attempt. They may not work out.

  • You’ve landed on a major limit with the 3d in construct. Collisions (including with the mouse) only happen in 2d on the z=0 plane.

    Seems it’s basically a problem of calculating if a ray from the camera to the mouse position is intersecting the sprite’s quad. Just a bunch of math since construct doesn’t have anything that helps with that. But you could try searching the forum for 3d ray cast for various possible solutions.

    If an object doesn’t have the spawn action just use the system->create action.

  • It’s the same.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Worst case you can use a css injector on your browser to change it.

    I did it here to change the pink to a cyan, but you probably could change more.

    construct.net/en/forum/scirra-website/website-issues-and-feedback-35/less-pink-175696

  • You can load it into the json plugin no problem. Then it’s just a matter of taking the data and creating equivalent construct stuff.

  • Else after a looping event block doesn’t seem too defined to me. Also you are toggling the Boolean instead of just setting to true. I suspect that is part of your issue.

    That said those are just general thoughts. I cannot follow your events and only have a vague idea what they are supposed to be doing.

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 155 followers

Connect with R0J0hound