R0J0hound's Recent Forum Activity

  • If the object origin is at the center you can do warping with two events:

    sprite: x < -self.width/2

    --- sprite: set x to self.x+640+self.width

    sprite: x > 640+self.width/2

    --- sprite: set x to self.x-640-self.width

  • That dropbox change broke all the links, just TAG the authors in a reply and if they're around they can fix those links.

  • Use this equation for x and y. Solving for scrollx1 and scrolly1 should do it

    (X-scrollx0)/scale0 = (x-scrollx1)/scale1

  • So i had another pass at my event based pathfinding. It works by the user placing node sprites all over the map in whatever configuration, and then modifying the "pick neighbors" function to pick the connected nodes from any given node. So then you call "astar" with the start and end node uids, and the function returns a comma separated string of the node uids that make up the path. I also added some events to then move along that path, but there may be cleaner ways to handle that.

    Anyways here's it with thin walls.

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

    And you can also do different kinds of pathfinding by changing up the "pick neighbor" function.

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

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • irina

    There is an image at every 360/sprite.count degrees on rotY. To rotate one at a time you could just change the value over time.

    Here's one way to change a value over one second from one value to another, but there are other ways.

    global number lerping=0

    global number t=0

    global number start=0

    global number end=0

    global number rot=0

    on click

    lerping=0

    --- set start to rot

    --- set end to rot+45

    --- set t to 0

    --- set lerping to 1

    lerping=1

    --- set t to min(0, t+dt)

    --- set rot to lerp(start, end, t)

    --- if t = 1

    ------ set lerping to 0

    Loading images at runtime would require a different plugin that lets a unique image be used per instance.

  • In psuedo events it should be this:

    On click

    --- set viewport size to (layoutwidth, layoutheight)

    --- wait 0 seconds

    --- snapshot canvas as png

    On snapshot

    --- browser: invoke download snapshoturl

    --- set viewport size to (640, 480)

    The wait is so the runtime has a chance to do the change, since it's delayed till the end of a tick.

    If it doesn't work, then i guess it doesn't work. I don't know if the scaling mode, the export method, or anything else has a bearing on it not working. I've had it work in the cases I've tested, but I don't recall what they were.

  • Why not

    X=int(mouse.x/64)*64

    Y=...

  • Here’s the latest one. There are other older ones.

    It’s not really a shame. It seems there is a lot of differing requirements for pathfinding that can’t be wrapped up in one plugin.

  • Set the window size that big before taking the snapshot. You may need to wait a tick first, and when it’s done sit the window size back. I think the action is set canvas size.

    Just use the vanilla c2 features, the paster object is not needed

  • Nothing I suppose. It’s just an alternate way to do it. Personally I don’t use plugins/behaviors as much since they don’t do exactly what I want most of the time. I just find it more painless to just implement it from scratch instead of bending a behavior to my will.

  • No, no problems. It’s great for repeating textures like that. It should be as fast as sprites, perhaps negligibly faster.

  • What they did was probably pretty simple. Each grid was a node and nodes separated by a wall weren’t connected.

    So then it was just a connected mesh of nodes that the path finding was done on.

    I guess what I propose is to do the path finding with events. You can look at any of my astar pathfinding example capx floating around the forum. The only thing that differs from any of them, wether they are on a square grid, hex grid, mesh or even with thin walls between nodes, is how neighboring nodes are picked.

    Or instead of just using those capx you can look at the red blob games blog. It has fantastic interactive tutorials for doing pathfinding algorithms.

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 157 followers

Connect with R0J0hound