R0J0hound's Recent Forum Activity

  • It actually looks like a combination of things. The water, falling lava and sand piling up looks like the "falling sand game." When particles are going fast or being pulled by something, it's just simple particle physics. Then when there are big clumps rolling around it's a rigid body physics simulation. All that with some logic to switch between the three in a fairly seamless way. It doesn't look like it's doing a true fluid simulation.

    They could have used an existing physics engine like box2d to do the rigid bodies, but it would need to be scanning the terrain and generating the collision polygons from the pixels pretty often. Making their own per pixel physics engine isn't out of the question. It actually is probably faster and simpler for their purposes.

  • Set the animation speed to 0, and just set the frame with events depending on if it's jumping or falling. For the running you can come up with a nice expression that changes between 0 and 1 over time.

    is jumping
    -- set frame to 2
    else
    is falling
    -- set frame to 3
    else
    -- set frame to int(10*time)%2

    The 10 in the last expression is the frames per second.

    But you can make it in another way too. No need for fancy expressions.

    global number runframe=0
    
    every 0.1 seconds
    -- set runframe to 1-runframe
    
    every tick
    -- set frame to runframe
    
    is jumping
    -- set frame to 2
    
    is falling
    -- set frame to 3
  • No worries for asking questions. It’s often hard to find answers to old questions.

    Sounds like you’re onto the start of a working solution.

    Basically all that’s needed to wall slide is to move out of the wall in the closest direction when you overlap a wall. The two parts to this is detecting where the walls are and moving away from the walls.

    Detectors can work for the first, but you have to be careful with the collision boxes.

    The moving out can be done by just moving out by a bit from each overlapping wall, using the detectors to know which direction.

    Here’s a rough example.

    Repeat 10 times

    — position detector sprites

    — detectorLeft is overlapping wall

    —— sprite: move right 1 pixel

    — detectorRight is overlapping wall

    —— sprite: move left 1 pixel

    ...and so on for up and down.

    So something like that would move out a max of 10 pixels out of the walls, a pixel at a time. Could prove jittery though, so you can make it move by less than 1 pixel. Also if it doesn’t move far enough you’d increase the repeats. It’s a balance between jittery and fast or smoother yet slow.

    There is also the custom movement behavior’s push out action. It does stuff like the above with one action. Could be useful.

    There are jumping issues with that behavior so here is a more precise solution. Makes very smooth wall sliding. Hopefully simple enough to copy paste over.

    construct.net/en/forum/construct-2/how-do-i-18/how-do-i-make-the-8-direction-95148

  • That looks pretty impressive. You couldn’t do that with construct. Indeed they used the gpu to handle all those particles at once, but shaders are only a subset of the gpu features needed. I mean they cold have also used cpu for a lot of it too. There are astounding amounts of performance gains to be had if you have the know how in assembly and stuff.

    What I like about games like that is they put a good amount of work in their own tech to create something cool that’s not easily repeatable by others.

  • It's like "1" in many programming languages.

    c/c++/java/javascript/...

    if(condition)
    {
    	//actions
    }
    else
    {
    	// actions
    }

    Even in indented languages like python it's like that. I guess it would be more like "2" in languages in lisp or something.

    Anyways, events are a lot like typed languages. For example some normal events would look like this in javascript or something like that:

    // trigger events
    function startOfLayout()
    {
    	action();
    }
    
    // game loop
    while(1)
    {
    	//all non triggered events
    	// normal two condition event
    	if( condition1 and condition2)
    	{
    		action();
    	}
    	else
    	{
    		//repeat 10 times
    		for(var loopindex=0; loopindex<10; ++loopindex)
    		{
    			action();
    		}
    	}
    
    	draw_frame();
    }

    The only added complexity is when you're doing stuff with picking.

  • Would this work? It sets a variable with the amount it wants to rotate, and as it rotates it reduces that number. Used an additional variable to keep from overshooting.

    global number toRotate = 0
    global number da=0
    
    on any key pressed
    toRotate = 0
    -- add 90 to toRotate
    
    toRotate > 0
    -- set da to min(100*dt, toRotate)
    -- sprite: rotate da degrees clockwise
    -- subtract da from toRotate

    Another idea is to lerp from one angle to another:

    global number startAngle = 0
    global number endAngle = 0
    global number t = 1
    
    on any key pressed
    t = 0
    -- set startAngle to sprite.angle
    -- set endAngle to startAngle+90
    -- set t to 0
    
    t<0
    -- set t to min(t + 10*dt, 1)
    -- sprite: set angle to lerp(startAngle, endAngle, t)

    There may be easing plugins to help with that too.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I need the following colours:
    R 255
    G 225
    B 0
    
    fading into
    R 255
    G 0
    B 255

    global number t = 0

    t<0

    --- set t to min(t+dt/2, 1)

    every tick

    --- set background color rgb(lerp(255,255,t), lerp(255,0,t), lerp(0,255,t))

    In the "t<0" event you can change the 2 to how many seconds the transition will take.

  • Have you seen the ask manual?

    scirra.com/manual/15/sdk

    It has more details about most of that.

  • I’d imagine there are no downsides. It’s just a form control so it’s simple enough to do. In the history of scirra though, they usually defer to third party plugins instead of making it themselves. No idea if they’d want to add it though. It’s usually easier and faster to implement it myself with js. That’s completely against the no programming required mantra, but it gets me going with something before I lose interest.

  • Thanks!

    I added a cheap perspective ability to the 3d rotate capx as a test. Ended up working decently.

  • Decided to have a go at it and it came out fairly simple. Well, it does touch on many different concepts. The language I came up with has an assembly/zzt feel to it.

    construct.net/en/forum/construct-2/your-construct-2-creations-23/more-rojo-tests-138761

  • Pandy

    I got carried away with some ideas and I posted an example here:

    construct.net/en/forum/construct-2/your-construct-2-creations-23/more-rojo-tests-138761

    Came out pretty clean. The idea is you generate the cube image any way you want, then only once per frame load an animation frame.