R0J0hound's Recent Forum Activity

  • mekonbekon

    I got a wild hair and tried an attempt. Only works if the object is onscreen because C2 doesn't draw off screen stuff. So the next step would to try something complicated to trick C2 to always draw in the cases we want. But that's ugly and hacky, plus that leads to an ever increasing number of side effects that would have to be handled. Baw I say, I like the event version better.

    roracle

    Those things are scrolling related, that's different than visually wrapping the layout from one side to the other.

    Ajbael

    The physics behavior doesn't work well when you set positions like that. I think the solution is what you're doing, except you need to wait till the next tick to restore the velocities. Anyways it's not something I want to re-figure out, instead you could use another physics behavior such as chipmunk, which works fine if you move objects like that.

  • An array is just a large amount of values. For a rewind just save the position of everything every tick. It doesn't make things slow.

    For example look here. It's basically just one action to record, and one action to rewind. Performance will be the same if you just started recording or have been playing for an hour.

    https://www.dropbox.com/s/9sgk5a2meazat ... .capx?dl=1

    Probably an array per object you want to rewind will do.

    It's based on this older example I made that makes a recording of every attempt.

    https://www.dropbox.com/s/lipjb22xahgej ... .capx?dl=1

    Now, if you can use lerp if you want to rewind slower than a frame at a time or want to account for variances in frame time. It's a bit more involved and probably isn't necessary.

  • A plugin probably could be made. The objective is to draw objects twice. So it could be done by replacing the draw function with two calls to the old draw function with two set positions in between. It’s not something I’m interested in doing.

  • 1)

    There probably are enough.

    2)

    Check the blog for the future plans. They also say they are doing well. Will C3 still be around in three years? Probably.

    You could learn JavaScript to make plugins.

    3)

    Pc’s are more powerful but it’s still possible to need to be concerned about performance.

    4)

    It’s dead simple. Why not try it?

  • How do you know you need that? Have you trie changing it to textarea intstead of text. That will let it be multiline

  • When you call the function you can pass the uid of an object as a parameter. Then in the function you can pick the sprite by uid.

    Start of layout

    Pick random sprite instance

    —- function: call “foo” (sprite.uid)

    On function “foo”

    Sprite: pick by uid function.param(0)

    —- do something with sprite

  • With unbounded scrolling on, make a duplicate of the tile map and put it right above the layout and another right below. The jump from moving the player from the top to bottom should be mostly undetectable. The wrap behavior is likely not sufficient so you’ll have to do:

    Player.y<0

    —-set y to self.y+layoutheight

    Player.y>layoutheight

    —- set y to self.y-layoutheight

    So basically you’re just duplicating everything to make it look seamless. You can probably get away with one deplicate instead of two if you position the duplicate depending if the player is close to the bottom or top. Moving objects can be trickier but the duplicate is always at the same offset from the original, a y difference of layoutheight.

    I’ve also used the paster object instead so that you draw the bottom part of the layout to it and move it above the layout when the player is near the top. The bottom is handled in the same way. Tile maps won’t work as is with paster because only the tiles onscreen will be drawn as an optimization. The trick to make it work is to move the paster and tile map objects onscreen first before drawing.

    Either of those will make it look like it’s seamless. Next thing to deal with is making stuff work across this seam. They’d have to be handled on a case by case basis.

  • That should be the case. Maybe post a screenshot of the event.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Just do it with events. Give the robot three variables vx=0, vy=0, and gravityStrength=400. In the click event it shows how to set vx and vy from a speed of 200 and an angle of 45.

    Global number gravityDir=0

    for each robot

    --- set gravityDir to angle(robot.x, robot.y, planet.x, planet.y)

    --- robot: add self.gravityStrength*cos(gravityDir)*dt to vx

    --- robot: add self.gravityStrength*sin(gravityDir)*dt to vy

    --- robot: set postion to (self.x+self.vx*dt, self.y+self.vy*dt)

    --- robot: set angle to angle(0,0,self.vx,self.vy)

    on click

    --- create robot at (player.x, player.y)

    --- robot: set vx to 200*cos(45)

    --- robot: set vy to 200*sin(45)

  • To arrange the sprites like in your example you can do this:

    for each sprite

    --- set position to (lerp(100, 300, loopindex/(Sprite.count-1)), 400)

    100 if the leftmost x and 300 is the rightmost. 400 is the y.

  • I won’t be doing that.