Colludium's Forum Posts

  • To add onto your idea, I would use some maths so that the force on the ball will be at a maximum 1/2 way up the slope with no force on top and no force at the bottom of the slope (simulating a varying gradient). Something like:

    Force = ForceFactorVariable * sin( 180 * distance(ball.x, ball.y, hill.x, hill.y) / (hill.width * 0.5) ) **

    ForceFactorVariable could be the mass of the ball x some other factor to get it to look right or to allow you to change the height of the hill. I would also add a check to correct Force to zero if Force < 0 , just in case the combination of collision polygon and distance measurement cause a negative value to be returned (that could happen in a corner of a square hill sprite, for example).

    Hope this makes sense....

    **edited for some bad public maths!!

  • Since it doesn't happen in debug, try adding a debug text of your own to the HUD to show the number of / position of and z layer of that object group. It might be being drawn but underneath the backdrop...

  • Does it happen in all browsers and node preview? I would also try and clear out the browser's cache, just in case...

    Having said that, I have seen only a couple of examples of this myself over the last year - all weird z axis problems that I couldn't figure out. After a frustrated attempt to fix by other means I just resorted to forcing the z order of the objects in question every tick to ensure that they were drawn in the right place...

  • SHG,

    I've tried a couple of different ways and by far the easiest way for me is to just manually shrink each sprite in the layout editor (ie keep the sprite's full resolution for full HD and make the instance smaller by a factor of 1 / 2.4) and keep the game resolution 800x450. I have a 'dump' layout and size the first instance in that layout; each next created example, whether it's drag and drop or using the 'create object' event will then be created with the resize resolution that I want. Then, on upscale to full HD, the sprites all retain a quality appearance as the engine scales them to 1:1.

    There is an alternative method, but I don't like it and I'll explain why (someone else might have found good ways to manage these problems and then it would be even easier). You could design the game for full HD and for the 800x450 export just set the canvas to that size at the start of the first layout, then set every layout scale to 0.42 at the start of each layout. Visually the effect should be the same, but window parallax problems can become apparent because of the scale effect and I've never found an easy way to keep the HUD aligned properly using this method. I mention it for completeness only....

    I've attached a simple layout capx that toggles between 800x450 and full HD. I think the question about scaling everything at run time would work on start of layout but you would find it almost impossible to manage in the editor window, because nothing would align like it would at run time. All graphics were in the public domain as far as I could tell.

  • Use events - on start of layout, create object: your array - this is the only way I know of.

  • Try adding Trigger Once While True in the Object In Tough event.

  • Just to check - when I say down-scaling in the editor I mean stretching each sprite so its length and width are 0.42 times the sprite image resolution (so a 1000x1000 sprite would be shrunk to 420x420). On a letterbox scaling up to full HD in a browser window then the full size sprite image would be shown in full detail with no blurring. This can only be done with sprites and spritefont objects; graphics like tiled backgrounds and tilemaps cannot be handled this way.

  • I agree and personally think that 800x450 with letterbox scale is a good resolution to start. I also like using a full screen button to allow the game to scale up to full HD if the player wants. To keep images looking sharp at full HD I scale the sprite graphics down in the editor so that they don't become fuzzy when C2 scales them back up.

  • I think Browser : Close will have the effect you want.

  • This was great to point out! I updated my HD4600 driver and set 3D to the NVidia for Chrome and my sprite count went through the roof! I was a little concerned that my new laptop wasn't doing too well LOL!

  • Yeah, I cannot say for sure when I started to notice it so it could affect the other recent betas.

    I'm suspecting that it might be something associated with the Spriter plugin. Yesterday I noticed a text object in the z order window that was being displayed with a Spriter icon. Rather disconcerting - the editor had also become laggy. Of course, it could be nothing to do with Spriter... I did a restart and everything was back to normal....

  • Update - see 4th post.

    I'm running r176 and I've recently noticed that the editor becomes slow to respond after a bit of use. This lag is particularly apparent when switching between layouts and event sheets - eventually I lose patience with the delay when opening a new tab and restart C2 - the problem then goes away for an hour or two.

    Has anyone any ideas what might cause this and what might fix it?

    Assets: 3.4 Mb

    Image Memory: 27 Mb

    Events: 400

    C2 memory use: 175 Mb

    .... So it's not using up crazy amounts of system resource.

  • Hurrah!! Glad to help .

  • Underdog, maybe I misunderstood what you wanted to do. If you want the sprites that are lower down the screen to appear z order higher than those that are higher up the screen then that one line of code is all you need to achieve it and your way seems quite complicated... If it's not what you wanted to do then I am just being confused. There is a potential gotcha if you use that code, you need a Pick All first if you're implementing it as a sub event straight after your create sprite event; or you could put the For Each loop in a function and call the function after the create sprite event.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If I understood you correctly, each time you create a new Sprite you could run something like this (as a function or add to the create event):