PortaCannon's Forum Posts

  • 14 posts
  • Found solution.

    Might be a chrome bug.

    (Not using "music" files anymore. Just using "Sound" files fixed the problem).

  • I just played my music files as sounds instead. Now seems to work (at the moment). In Chrome.

  • I have, but I'd rather avoid it. It is a decent sized file and takes a long time to load.

    I don't think I need to preload it -- as Kyatric's Asteroid clone does not preload the music when it switches between stages.

    scirra.com/tutorials/358/asteroid-clone-in-less-than-100-events/page-1

    So... since his works... not sure why my basic example is not working.

    Is it possible that Construct 2 starts streaming the first file, then when it switches, it tries to stream both files??

    Very bizarre.

  • --------------

    Found solution

    --------------

    Seems to be a bug when playing music files in Chrome.

    Just set my music files as sound files instead. No problems now.

    Also, music files were interfering with my pathfinding. Now that they are set to sound files, there is no issue.

    ----------------

    Original Problem

    ----------------

    Hello,

    Not sure why this is happening.

    I've loaded two music files, both work fine when played on their own.

    For example:

    ---

    On Layout Start

    -> Play "Music 1" looping. Tag = "Music 1"

    ---

    ((Music plays on startup))

    Then I added a sprite "button" which should stop Music 1, and play Music 2.

    ---

    On "Sprite 1" clicked

    -> Stop "Music 1"

    -> Play "Music 2" looping. Tag = "Music 2"

    ---

    *When running in debug, it shows the first music play, then when the sprite is pressed, it shows the first music stop and second music as "playing". However, the second music does not play (music time playing stays at zero).

    Am I missing something simple?

    Should I pre-load the second music file??

    Thanks for reading.

  • maybe pin a sprite above the character to detect solids.

    create Sprite "solidsensor"

    10 by 10 pixels. invisible.

    on layout start: set position to player.x and player.y+30

    set pin to active

    if solidsensor collides with "blocksprite," set global variable "moveupallowed" to 0, else, set to 1.

    on key pressed "up", (when moveupallowed =1), move player up.

    maybe that type of logic would work?

  • Best way to start is by downloading images from the internet onto your desktop.

    Then just drag them into construct 2.

    To make your own images, I recommend Photoshop. But to be honest, I would just use internet sprites until your game is half decent.

  • I have a picture on my website here (that one didn't seem to work):

    portacannongame.blogspot.ca

  • Here is an example of the type of map I'm going for (using RPG maker to rough out my maps initially).

    So you would recommend using a repeating tiled background for the water, and maybe cut the land portions down into 256x256 segments perhaps?

    <img src="http://portacannongame.blogspot" border="0" />

  • Thanks for the advice! I will give it a shot and test it out.

  • Hello,

    Wondering if anyone has an idea for reducing the lag caused by a large map sprite.

    I was considering chopping it up into smaller sprites, then setting the sections visible to the players location. so at any given time, only 4 of 20 map sprites were being drawn. would this help? or would it be better to just cut the map into smaller sprites and display all?

    I could destroy instances of the sprites, then spawn when needed?

    Thanks!

    Also, I will be using a lot of solid "block" sprites to section off the walkable areas. is there a better method than this?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That ended up working, thanks!

    I pinned the bullet "character" sprite to an 8 directional "character mover" sprite.

    So now I still have my 8 directional animations working great (based on what angle the 8-directional mover sprite is at).

  • Hello :)

    I have a thruster bar that is supposed to increase over time (up until a max). Then be "used up" when a key is pressed. The level of thruster available is displayed as a sprite with different animations (example: when thrustervariable = 5, display animation: thruster5).

    What has been happening is: when the x button is pressed, you cannot see the thruster bar move. It goes from max to zero.

    The code is essentially:

    • When "X" pressed, increase speed & start thruster decrease

    -When Thruster decrease = on,

       -Wait 5 seconds, decrease "thrustervariable" by 1

    • When "X" released, set speed to normal
    • When "X" released, set thruster decrease to off, set thruster increase to on.

    -When thruster increase is on, wait 10 seconds, then increase thrustervariable by 1

    ---

    *For any variable that is supposed to increase or decrease over time, do I have to give its display sprite priority over the event adjusting the variable?

    For example:

    every tick/display animation "thruster(thrustervariable)"

    when(x) pressed/wait 5 seconds/decrease thrustervariable by 1

  • Hmm... maybe if you assign a unique id to each of the bad ninja instances?

    It sounds like it might have the following logic:

    • If (any)Ninja sprite hits player with invisible star, then throw star

    Instead of:

    • If Ninja1 sprite hits... (only)Ninja1 shoots
  • Hi there,

    I have a 8-directional sprite as my character.

    It's top down, so I have a square "map area" that they are able to walk around in.

    I put solid sprites around the map area, but I find that the character can "force" their way through the solid by holding down an arrow key.

    I'm guessing there is a simple solution to this.

    Thanks!

  • 14 posts