WackyToaster's Forum Posts

  • One thing I found to work really well depending on the case is to simply stop and restart the sound.

  • The button object can be customized via CSS.

    A sprite button can simply be done by using Mouse > On object clicked.

    Opinion: Don't use the button object

  • You'll have to regenerate the obstacle map. This is cost intensive and thus not done automatically.

    construct.net/en/make-games/manuals/construct-3/behavior-reference/pathfinding

    You have "Regenerate obstacle map" which is probably not needed for your case since it regenerates the entire map.

    So you probably wanna use "Regenerate region" and just select a region around the deleted tile.

  • Oh you want to avoid the black bars... I dunno if theres really a way around changing the scaling mode. You probably could go with "scale outer" and just strech the background out a bunch without changing the position of your game objects. Or maybe "scale inner" works better in your case?

    construct.net/en/tutorials/supporting-multiple-screen-17

    Unless you somehow figure out why the css doesn't work. Perhaps there's some specific css property you have to set for ios or something in xcode? Maybe the url path is different on ios and it just loads a white image? Maybe try url('./paper_background.png')

  • Hmm I can't tell what could possibly be wrong but why even bother adding it via CSS? You should be able to just add the image as a tiled background, with maybe a little bit of tinkering with the Anchor plugin so it scales properly to the screen size. construct.net/en/make-games/manuals/construct-3/behavior-reference/anchor

  • I just tried it and r0j0 is correct. I can't update the project on my server right now but if you replicate the screenshot it will work perfectly. Also it will work fine with timescales :) Thanks r0j0

  • Hmm I just can't quite get it to work

    wackytoaster.at/parachute/notquitephysicstargeting.c3p

    I've tried various versions of the equation but it never quite works for all distances. I'm not sure what I'm missing...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You do not have permission to view this post

  • Nouan

    It's hard to make any guesses based on that. If a crash happens, you can maybe check the developer console (F12 in chrome) and see if there are any errors showing up.

  • Hmm now that I think about it, this is probably a bit more complicated. The physics plugin uses more variables that will affect the trajectory. Like mass/density and dampening. Since construct uses box2D under the hood I searched if there's something on that and found this answer but the math is beyond me and I don't have time right now to read into it.

    stackoverflow.com/questions/20208642/draw-dynamic-projectile-curve-in-box2d

    Maybe R0J0hound can help here.

  • You will have to cook up a system that checks for that. Something like: Go through all keys that should be there and if it isn't, add it.

  • It's hard to make any guesses based on that. If a crash happens, you can maybe check the developer console (F12 in chrome) and see if there are any errors showing up.

  • Perhaps this can help you, although it's not directly made with the physics behavior in mind. The math should probably be roughly the same I think.

    howtoconstructdemos.com/trajectory-calculation-two-methods

  • Ashley wrote somewhere that collisions are something we have to handle ourselves in javascript. He also wrote that internally a collision is "is overlapping & wasn't overlapping previous frame" but that doesn't appear to be the entire story.

    Example: The platform behavior lands on solid ground. With events this correctly triggers a collision, makes sense. But in javascript with just a testOverlapSolid() it never triggers. So without tearing open the platform behavior again, I have to assume that there is a piece of code that roughly does:

    1. Execute the movement

    2. testOverlapSolid() -> if true trigger collision

    3. Push out solid

    So when my scripts are executed, the platformer object will just never be overlapping the solid. So I came up with this, which sort of works

    const sprites = runtime.objects.Sprite;
    
    for(const i of sprites.instances()) {
    	const vec = {
    		"x": i.behaviors.Platform.vectorX,
    		"y": i.behaviors.Platform.vectorY
    	}
    	const prev = {
    		"x": i.x,
    		"y": i.y
    	}
    	
    	i.offsetPosition(vec.x*runtime.dt, vec.y*runtime.dt);
    	if(i.testOverlapSolid()) i.setAnimation("Animation 2");
    	i.setPosition(prev.x, prev.y);
    }

    At least I think it does what I want it to. I have to be cautious to only execute this code after any potential changes to the vectors (e.g. jumping, knockback) which is fine.

    The main issue I'm having is that this technically triggers the collision a frame to early. So I kinda need to only register the collision first, and then handle what it should do the next frame. Is this the right approach? My gut feeling tells me this might be prone to a bunch of edgecases but maybe I'm mistaken...

    Of course I could possibly also just handle this in events, but that's not the point :V

  • Oh absolutely. I just wanna make sure that I'm not making something more complex than it needs to be. I hate being in the middle of a project and realizing that I could have done some things much easier + my code tends to spaghettify anyway and it's harder to maintain. So I kinda started to look for the most simple and effective solutions I could possibly think of so I don't get frustrated when the code is a maintenance nightmare. It's hard enough as is :)