R0J0hound's Recent Forum Activity

  • Waltuo

    I'd recommend just using physics, but you could try it. Whenever you switch between the two be sure to set the velocities from the other behavior.

  • What does Firefox have to do with it?

    I can see why it would jitter. The distance the Sprite moves each frame will vary with dt, and since the "push out" action works something like the following I could see why some frames the Sprite would move and some it wouldn't.

    While

    Sprite overlaps solid

    --- move backward 1 pixel

    There are two reasons why box2d doesn't jitter. The first is it uses a fixed timestep, and secondly it calculates how far to push out.

    You probably could do either and eliminate the jitter.

  • It's still 3d. The most basic way involves a skybox, a pre-rendering of the view from the 6 sides of inside a cube.

    https://en.wikipedia.org/wiki/Cube_mapping

    To do it in C2 you'll need a way to draw the inside of a textured cube, or more simply a way to draw a texture onto a polygon with perspective. A third party 3d plugin like q3d probably could do it. Outside of that it will be complicated.

  • Well, you'd have to do more to make your game with it. C2 has a lot of things already setup for you, whereas kivy leaves that up to you.

    Whether or not the end result is faster really depends on you. Python can be slower than JavaScript, but then again it's easier to use c or something for the time critical parts if needed. Also since you'll be writing more code to setup how your game works you'll have to make more decisions that can impact performance.

    As far as size, the resulting program file size would probably smaller I'd imagine.

  • There's this section of the forum with a list of existing plugins and behaviors you can use as well as a topic about how to install them.

    Once installed you can use them like any bundled plugin.

  • After a little digging it appears to be a limit imposed by the box2d library.

    http://www.iforce2d.net/b2dtut/gotchas#speedlimit

    You can change it in the physics/runtime.js file in line #79:

    Box2D.Common.b2Settings.b2_maxTranslation = 2.0;[/code:3sww5aym]
    The 2.0 is in box2d units, so to double the max speed set it to 4.0.
    
    That's for the "box2d web" version of the "Physics engine", which you can select in the project properties.  I'm can't find where to change the setting in the "box2d asm.js" version since it's minified.
    
    Alternatively you could use the chipmunk physics behavior, it doesn't appear to have a limit.
  • C2 uses degrees instead of radians so t should be 360*random(). With 2pi it would only be about 6 degrees which is what your first pic looks like.

  • Ah, I misunderstood. So if it only happens in the debugger I'd say that can be expected since the debugger does more stuff such as displaying all the values in the array.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you're loading the array once, you'd at most get a pause depending how big the array is. If it's impacting the fps then that sounds like you're loading the array every tick.

  • jojoe

    % gives you the remainder after a division.

    Ex

    5%5=0

    4%5=4

    15%5=0

    33%5=3

  • While it never is 1 exactly, it can be pretty close. ex: 0.99999999999 which is practically 1.

    Do you have a use case in mind? I've only ever needed 1 included if the number was an integer.

  • Tokinsom

    C2's webgl renderer looks like it was updated to have more parameters for effects. Looking at that particular line it looks like time is now passed to the effects.

    Looking at line 408 in paster/runtime.js

    glw.setProgramParameters(this.temp_texture, 	// backTex
    	 1.0 / inst.width,		// pixelWidth
    	 1.0 / inst.height,		// pixelHeight
    	 0, 1, 					// destStartX, destStartY,
    	 1, 0,					// destEndX, destEndY,
    	 1,						// this.getScale(),
    	 0,						// this.getAngle(),
    	 0, 0,					// this.viewLeft, this.viewTop,
    	 0.5, 0.5,				// (this.viewLeft + this.viewRight) / 2, (this.viewTop + this.viewBottom) / 2,
    	 inst.effect_params[etindex]);[/code:3p0kd6dd]
    
    Add this line: "this.runtime.kahanTime.sum,"
    [code:3p0kd6dd]glw.setProgramParameters(this.temp_texture, 	// backTex
    	 1.0 / inst.width,		// pixelWidth
    	 1.0 / inst.height,		// pixelHeight
    	 0, 1, 					// destStartX, destStartY,
    	 1, 0,					// destEndX, destEndY,
    	 1,						// this.getScale(),
    	 0,						// this.getAngle(),
    	 0, 0,					// this.viewLeft, this.viewTop,
    	 0.5, 0.5,				// (this.viewLeft + this.viewRight) / 2, (this.viewTop + this.viewBottom) / 2,
    	 this.runtime.kahanTime.sum,
    	 inst.effect_params[etindex]);[/code:3p0kd6dd]
    And that should fix it.  I can't test, webgl no longer works on my pc.
R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 157 followers

Connect with R0J0hound