R0J0hound's Recent Forum Activity

  • Give the deer the bullet behavior and a text instance variable that we'll call brain. Then do events like this. 64 is the look ahead.

    Every tick

    --- deer: set angle to (player.x, player.y)

    --- deer: rotate clockwise 180 degrees

    --- deer: set brain to "run!"

    --- deer: move forward 64 pixels

    Deer is overlapping tree

    --- deer: set brain to "tree!"

    Every tick

    --- deer: move forward -64 pixels

    Deer: brain = "tree!"

    Deer: is clockwise of angle(deer.x,deer.y,tree.x,tree.y)

    --- deer: rotate clockwise 45 degrees

    --- deer: set brain to "run!"

    Deer: brain = "tree!"

    Deer: is counter-clockwise of angle(deer.x,deer.y,tree.x,tree.y)

    --- deer: rotate counter-clockwise 45 degrees

    --- deer: set brain to "run!"

    EDIT:

    Just realized this will only work with one deer and one tree as is.

    To make it work with more than one deer put everything as subevents of a "for each deer" event.

    More importantly to make it work with more than one tree we need to pick the same tree the deer overlapped in the last two events. You can do this by setting a global variable to the tree's uid in the overlap condition. Then use pick by uid in the last two events to pick it again.

  • My only critic is you need more on your channel. Good stuff.

  • There are many. Add a Sprite then click on the add effect link in the sprite's properties. There you can look all the bundled or included effects. One of them may do what you want. If not look at the link I provided and one of those may do it.

    If all else fails the manual has info about effects. You can even make your own if you're so inclined, but you shouldn't need to in the case of what you want to do.

  • Yes. Look at the bundled effects or try one of the ones in the link.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • What have you tried so far?

    Minus the graphics, can you make that slope there with collisions?

    One way often used is to use multiple sprites to define the slope. So say you have a circle sprite you could place them in a row on the grass level. More advanced ideas would be to stretch a rectangle sprite from circle to circle to make the surface smoother.

    Anyway, to make the slope continue you just add sprites to the right of the last sprite.

    In the simplest case you can do this:

    Global x=0

    Global y=0

    While

    compare: x < screenleft

    --- set y to 100*sin(x)+320

    --- create sprite at x,y

    --- add 32 to x

    The "set y" expression is how your slope is defined, and you can do anything with it. Some examples:

    100*sin(x)+320 is just a sine wave

    100*sin(x)+50*sin(x*3+22)+320 is two sine wave combined to make a varied slope.

    (noisejs.perlin2(x*0.44, 0.5)+1)*100+320 uses the noise plugin to use perlin noise.

    Noise plugin:

    terrain examples:

  • Prominent

    It's the same as far as I know. The browser could cap the fps, but I don't know since I've only ever used 60hz displays.

  • Giganten

    It should, although I'm not sure if "fps" will have a good value at that point. You could wait a second or so first first.

    Just leaving the timestep at 1/30 means if the refresh rate is 120 the physics will run twice as fast than if the refresh rate were 60.

  • remy-jay

    How are you using pathfinding? That line just moves the Sprite. So does the pathfinder but maybe it messes things up when manually moving a Sprite while it is following a path. I'm not sure.

  • This may help:

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

    This creates a shadow sprite for each object of the family.

    The shadow keeps track of the uid of the object it's paired with and how high it is, which i call "z".

    Then to move the objects I just move the shadow and put the objects's position to (shadow.x, shadow.y-shadow.z)

    For the jump I added another variable to shadow called "vz" which is just the vertical speed. Then I use the following to make it accelerate down due to gravity (400) but stop when z is 0. The result is a nice parabolic motion.

    every tick:

    add 400*dt to vz

    set z to max(0, self.z+self.vz*dt)

    Then to make it jump just set vz to -300 or something.

    You could change it up to move the shadow instead of the object. ( shadow.y=object.y+shadow.z )

    Just be sure to change the object's y when the z changes.

  • It's running smooth enough here with chrome. I used to get some pretty serious jank with firefox so I switched browsers. As far as I can tell the reason for the jank has to do with the rendering portion of the browser when a graphics card isn't supported well. Which is the case for my machine with all browsers.

    Here's a sinple js test I made a while ago to see how smooth motion can be in the browser:

    In chrome I get a slight variation in frametime but it's not terrible. Still it can be distracting to the eye.

  • It's used in BASIC, SQL and probably others.

    != is more common and is used in c, Python and JavaScript off the top of my head.

    Some languages even use something different like ~= in Lua.