R0J0hound's Forum Posts

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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.

  • I'm going to start posting miscellaneous capx projects I have here from time to time.

    Here is simple way to rotate a bunch of 3d points. It also utilizes the paster object to generate a cube image.

    dropbox.com/s/yb88xggzokotev5/3d_rotate.capx

    This is a simple programming language and interpreter test. It has boolean variables, if's and goto. Kind of has an assembly like feel to it. I kind of fudged on error checking but it works well.

    dropbox.com/s/xcmd72wq8zme91p/proglang_parser_and_interpreter.capx

    Example script that moves from wall to wall:

    forward
    if angry forward
    ifnot wall goto end
    log ouch
    set angry
    right
    right
    :end
  • I have a discord I haven’t used in ages. I probably should install it again.

    Edit:

    My discord name is reddog

    Had a look in your capx. Didn’t have “Rex function” or “polygon” installed so I removed them. Looks like one wasn’t used and the other, polygon was just another option from paster.

    I will say the polygon plugin is probably your biggest bottleneck. It has the same issue the canvas plugin had. It draws to a hidden canvas first and is copied to a webgl texture. This is slow and uses a lot of memory when drawing many polygons.

    I noticed you’re using some JavaScript. I usually define the functions once in a start of layout. To make the functions accessible later you’d define them as

    window.myfunction = function(){};

    Instead of

    var myfunction = function(){};

    Or

    function myfunction(){}

    And the beauty of it is you’d still be able to call the function as myfunction().

    Window is the global object.

    You can do it with just events as well. Might look more readable.

    One thing I do to make my expressions more readable is to avoid using tokenat or even array.at as much. Probably just a personal preference.

    For max performance you could do almost everything in JavaScript and only do minimal stuff in events like add cubes, set the view rotation, and request it to be drawn. Kind of loses the fun of using construct though if you run into js errors.

  • Last I looked you can get at the runtime parts of the plugins when you are previewing. Open up the browser’s debugger and in the source code section there is a list of js files. Some of them are the runtimes of the plugins. It was that way when I looked last at least, which was around when c3 first came out.

    Edittime is inaccessible as I recall. It’s all minified.

  • I don’t know about that, but if he has a particular language he wanted to make in mind, things can be simpler/easier.

    Simplest would to not do a parser at all and just add a list of commands to an array, loop over the array and depending on the command do something. Of course you can get a lot more deluxe.

  • If you pick the object you want to duplicate and store sprite.asJson in a variable, you can then create a new sprite and use the “load from json” action to make the new instance identical. You’d then manipulate the new instance as you see fit.