R0J0hound's Forum Posts

  • I'm no longer updating plugin's but there may be a leak. Garbage collection doesn't happen immediately when something is destroyed so there's that. The runtime also does something called object recycling that doesn't actually delete the destroyed object so new objects can use it. That is so less garbage is created.

    I do know the main memory and cpu hog is every frame the canvas is drawn to I had it create a new webgl texture of it and discarded the previous. Honestly I've never been interested enough to improve that. The plugin was made before c2 had the webgl backend so maybe that explains that.

  • What's actually happening is the sprites are being marked to be destroyed at the end of the event. They aren't being destroyed right then which is why they can be picked multiple times.

    One solution would be to add a Boolean variable "alive" with an initial value of true and then do this:

    Space pressed

    Repeat 3 times

    Sprite Is alive

    Pick random Sprite

    --- Sprite: set alive to false

    --- Sprite: destroy

  • Is the canvas object at the top left of the layout?

    Maybe use

    Mouse.x-canvas.bboxleft

    Mouse.y-canvas.bboxtop

    If it isn't.

  • You could just set the initial value of the frame variable to 1. Unless I'm misunderstanding what you're saying.

  • Desktop was an example, mobile is basically the same. Mobiles have more performance issues because they are weaker than desktops.

  • All the functions and globals made it hard for me to follow what the events do. Here's a simplified version that's a lot more readable to me:

    https://www.dropbox.com/s/tdcv8lil8p14f ... .capx?dl=1

    Maybe that's helpful. Yours may just have one or more simple typos somewhere.

  • Ok, now I can at least somewhat understand your events. The issue is event 44. To fix change it's condition to "else".

    what happens in that function is:

    if var != 4 then add 1 to var

    if var == 4 then set var to 0

    So if the var is 3 going into the function it will first change to 4 and then set to zero right after.

    The whole event sheet is kind of stretched out. You could simplify it to around 10 events i'd think.

    Edit:

    You're also messing with that frame variable at the end of the "Spawn_Ec_Ships" function. That probably also will cause the same kind of problem.

  • I'm not clear what the issue is. In the initial capx you wanted to create multiple sprites and have each one have a different frame. The solutions you got so far seem to correct that.

    Your Larger capx just creates four different sprites. I can't tell from your descriptions how you want it to want it to work. and in what way the result not correct.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There's a variety of ways other programs do it. To most "native" means an exe is produced and the game doesn't run with an interpreted language like javascript. Or in other word the runtime is made in a compiled language.

    Construct classic had a runtime and plugins made from compiled c++ as an exe and dlls. When exporting all game resources were then just put into the exe.

    Gamemaker does something similar as far as I recall. At one point before they added encryption they just put all the game scripts as is inside the exported exe, and the exe would read and run it. It probably does the same now.

    Gdevelop looks to have the option of generating c++ code from the game project and some compiler is used. They may use resource packing as above because a compiler doesn't seem to be required.

    zGameEditor looks to implement it's own compiler that generates an exe directly.

    Godot uses precompiled runtimes that resources are packed into as well.

    Unity may either just pack resources or utilized a c# compiler to generate the exe.

  • link updated

  • marceloborghi

    It works here.

  • ome6a1717

    Put int() around all the values. Numbers with decimals will make it not work.

    ChesVCF

    There should be an action to set the canvas' resolution. That won't resize the image though. For that load the image in a sprite or something, make the sprite size 32x32 and paste it to a canvas of size 32x32.

  • Here's the example on how to draw an distorted quad with the paster object:

  • jobel

    There's a dropdown to select between rect and polar. Select polar and set the angle to shooter.angle and dist to 500.

    For the bouncing adjust the friction. High friction absorbs perpendicular motion on a bounce.