R0J0hound's Recent Forum Activity

  • UIs are interesting with all the different ways to go about it.

    So instead of using say a 9patch you draw things directly so you can change the border width on the fly?

    Do you have a mockup of the kinds of ui that you are after that this will ultimately help you make? I ask because currently there are other ways to do what you have without a plugin, but I also know there’s often a lot of simpler things that have to be implemented first before getting to the useful parts. Like you mentioned that doing it with events had limits and was cumbersome. In what way do you hope to reduce the friction and limits? I guess the general goal would be enough to see what you’re working towards.

    Anyways, keep it up. More options are always nice and especially as things get more complex I can see a plug-in being more useful and faster than rolling it another way.

  • Here's a test of the idea. I used a higher resolution tilemap to make the water motion jump in smaller steps. I also made it so cells can have higher priority so it fills falling the shape of the corridor more or less.

    dropbox.com/scl/fi/g9pu4fcr9qdkmo7weqjbw/flooding_idea.capx

    Again you probably could make the motion smoother by gradually moving the flood sprites from one spot to another and running the flood function once they stop at the destination.

    One thing I'm not super happy with is we have to call the function from separate events instead of under a repeat condition. That's do to a quirk with picking and newly created objects.

    A smoother and more complex idea still could be to trace the polyline that makes up the corridor and then starting with the point where the water starts from move two points to the left and right along the polyline. That would basically give us a fill line. Probably could come up with some kind of logic to decide how far each edge point should move to add a certain amount of water per frame. I'd imagine you could borrow some ideas from a triangulation algorithm like "ear clipping." Anyways, that's just a general idea, I'd imagine it may end up being simpler to do than you think but I'm not sure.

  • Your example seems to flicker badly after a while. I guess c3 updates are obsoleting my hardware.

    Anyways, you could possibly use a floodfill algorithm to fill the empty cells. Basically mark the start cell, then fill it and mark the empty neighboring cells, and repeat. To make it smoother you could use a sprite animation instead of filling a cell right away. Or if you keep track of the edge cells you could position some sprites around there.

    Just an idea.

  • Ashley is male and reporting bugs has always been unrewarded.

  • If you’re using the move to behavior to move the object then you need to use the moving angle of that. I only used 8dir as an example as I had no idea what behavior you used to move.

    On a slightly unrelated note I see you used pi/180 in your expressions. That isn’t needed. Construct uses degrees for everything so you practically never have to convert to radians.

  • Maybe:

    Player: 8dir: is moving ?

    — player: play animation sin(self.8dir.movingAngle)<0?”walkNorth”:”walkSouth”

    —player: set width to abs(self.width)*(cos(self.8dir.movingAngle)<0?-1:1)

  • To expound on the math idea here’s how to calculate the y to place the object just off the bottom of the screen. Untested but the math should be correct.

    Var s=0
    
    Start of layout
    — create sprite at 320,240
    — sprite: set zelevation to random(-150,0)
    — set s to 3dcamera.DefaultCameraZ/(sprite.zelevation-3dcamera.DefaultCameraZ)
    — sprite: set y to viewportHeight(0)/2/s+self.height/2+scrolly
  • So you want the projected bounding box of the object at different z elevations.

    You may be able to get somewhere with the expressions to convert from a position to a layer.

    Mathematically you should be able to calculate it with the object’s position and the fov of the camera. Basically a 3d projection to the screen if you want to find more info about that online.

    A third way is to just do some trial and error.

    Like set y to y to self.y-k*self.zelevation

    Fiddle around with the value of k till everything is just offscreen.

  • Set it invisible till you finish positioning it if you do it over multiple frames?

    Or depending on the size of the object you’d need to create it further off screen so it’s not seen.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Maybe try disabling workers in the project properties. Otherwise if the code is run in a worker you’re limited what you can access. so maybe that’s why window.parent isn’t defined.

    That’s the idea at least. I did some minimal digging for docs about that and some minimal testing, but I’m not really going to explore that further.

  • You just use JavaScript directly in construct 3. Right click in the event sheet and add JavaScript. It serves the exact same function as execjs

  • Have you first checked that the TimeLeft variable is set 100 so that it can run?

    I guess you could check to see if those load actions take the name of the file or do they want the contents of the file. If they need the contents you could paste that into the action or load the file with ajax into a variable or something.