TwinBlazar's Forum Posts

  • BUMP

    Ashley, do you have a suggestion for this case?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Could you check whether your nodewebkit is using canvas2d instead of webgl? If so, refer to

  • Developing app for NodeWebkit here. Currently I have a looping music that requires looping, but it got a long intro that is not a part of the loop.

    For example,

    Subscribe to Construct videos now

    This music here got a very long intro of 69 seconds, and at about 4:02, the music loop back to the 69th second.

    I got a music like that, so I would like to check the music's time position every tick, and if the music exceeds certain time, I would like to seek back by x seconds to make it sound seamless. These could be simply accomplished with Audio.PlaybackTime("music") and { Seek Tag "music" to x seconds } event.

    However, I notice that sometimes "seek to" causes the music to stop playing for several hundred millisec and it's as if the program requires a bit of time to load this particular part of music into memory first. It may or may not happen, but when it happened, it is not good for looping music. Music should be seamless.

    Yet I found one possible hack for this, and that is to import the music in as a "sound effect" instead. This time, the music runs flawlessly with "seek to". I can "seek to" anywhere and there are no stuttering.

    However, this hack comes with the following penalty: high memory usage and longer preload time. Instead of less than a sec preload, this time, it takes about 3-4 seconds. (My music is 7 minutes long) Checking into Task Manager, I see that the Node Webkit takes 220 MB memory now. On the contrary, it was only 61 MB, when I imported this music as "music" and not "sound effect".

    While this hack works, the memory consumption just for one music alone is way too harsh, and I got other music as well. I can accept the 3-4 seconds preload time, but not the memory consumption with only just one music. Is there a way to unload or are there some better alternatives for this?

  • Oh MY GOD Jase00, you sir, win one Internet.

  • Currently I am having a weird problem.

    I just migrated my project to another computer, and then when I previewed my game as NodeWebkit, I see that it is using Canvas2D, rather than WebGL. I've tried switching previewing on Chrome instead. Strangely, it uses WebGL.

    I was wondering whether some parts of my project are affecting this, so I tried load up the Ghost Shooter, and preview it. It also says Canvas2D.

    I thought, perhaps something is off in Construct 2's NodeWebkit configuration somewhere, so to test this, I grabbed my project that has been exported as NodeWebkit 4 months ago. I ran it, and surprisingly, it is also using Canvas2D. It never runs in Canvas2D before...ever...

    Does anybody know what's going on here? My Chrome can run in WebGL, but how come NodeWebkit just runs only in Canvas2D, even for an older exported NodeWebkit?

    Just in case, my GPU is GT 240 DDR3 1 GB. I've tried applying "ignore blacklist configuration", but that does not help.

  • What you want required no more events from my capx.

    From my capx, how about you stretch the "down arrow" to fill the upper half of your screen, and stretch the "up arrow" to fill the lower half?

    Now, place the solid in the middle, and voila, you will have what you want in no time.

    This way, we won't be dealing with line of gravity, and you can specify directly which area should be up or down by placing and stretching these gravity arrows. Additionally, you can turn these arrows invisible for aesthetics purpose.

  • Actually, "on created" event will run for all objects on startup as well. Because when the layout is loaded, these objects are created on the layout immediately.

  • Here is the capx: http://www.mediafire.com/download/r5dbckk56xjccb6/gravityExample.capx

    Inside the capx contains these objects:

    The black solid floor/ceiling are the same object.

    The stickman is the player, having Platformer behavior.

    The arrows are just 2 different sprites for Gravity Up and Gravity Down.

    Now, in event sheet:

    When player collides with Gravity Up arrow, he will be flipped and his angle of gravity will be set to -90, causing him to have reverse gravity. The same applies for the Gravity Down, but it sets him back to original gravity.

    Angle of Gravity is one of the attributes in events of Platformer behavior. Only objects with Platformer behavior will have this Angle of Gravity listed.

    Try run the capx.

    Are you ok now?

  • You can create a placeholder Gravity setter object (and set it invisible). This object could be an ordinary Sprite. In Event Sheet, when your player or enemy collides with it, you change "angle of gravity" of your platform behavior.

    If you need more help, just say so.

  • I think you are only disabling collision on all objects on startup. But for new objects, when created, do not have collision disabled. You have to disable them via "on create" event.

  • Yikes, I just read my post again. If it's not helpful to you, as in you have hard time interpreting my text, feel free to ask. I will try to tone down my wording and try to put myself into your shoe more.

    But do you understand what I am saying above?

  • This wont cause any problem.

  • Simcity... this could be very difficult.

    You have to play around with tilemaps. https://www.scirra.com/manual/172/tilemap

    Imagine left click set a tile to a road tile.

    What if a road has intersection, does it have to be set to a T-shaped intersection or + shaped intersection? You need events to take care of all these.

    For people going from one place to another, they must be able to know their shortest path. There is pathfinding feature in C2: https://www.scirra.com/manual/154/pathfinding

    But before I overwhelm you further, could you please try create a simple program first where:

    1. There is a road with several intersections.

    2. A person walks from point A to point B on the road.

    Try do the above first before proceeding any further. If you need help on specific features, create new topics for those.

  • You can use variable like this:

    For each sprite,

    • if instance variable A is 0, set instance variable A to 1 and execute some codes further.

    This will make the code above executed once for each instance when its instance variable is 0. Set instance variable to 0 again somewhere for a particular instance to have the event run this part again for that particular instance.

    Don't use "trigger once". If my memory is correct, it is not applicable in for each loop.

    Actually... can you tell us your big picture? What are you trying to do?

    not sure whether this will help you.

  • How about use "Compare X" in "for each" instead of comparing the variable "whichSide"?

    For example,

    Press Left

    • For each,
    • - if x < 400 : Sprite.x = Sprite.x -120
    • - else : Sprite.x = Sprite.x +120

    You have to place something like Solid objects in the middle to prevent the sprite to go to the other side. (otherwise, with this method, you might have a bug that both sprites move together on one side.

    Logically, it is acceptable...

    OR actually, a simpler method would be:

    create 2 sprites with exactly same animation, etc., but name them differently, maybe player_LeftSide and player_rightSide.

    Now, in your events:

    Press Left:

    • player_LeftSide.x = player_LeftSide.x - 100*dt
    • player_RightSide.x = player_RightSide.x + 100*dt

    Press Right:

    • player_LeftSide.x = player_LeftSide.x + 100*dt
    • player_RightSide.x = player_RightSide.x - 100*dt

    This will allow you to make do without using "For Each". However, this event design may make you doing things for the player twice.

    Is this ok for you?