mekonbekon's Recent Forum Activity

  • imhotep22 I can't see anything obvious, but there a couple of avenues that might be worth be pursuing:

    1) The "every 2 seconds" - I don't think this triggers immediately but only after 2 seconds have passed i.e. it won't trigger on 0 seconds. That may of course be your intention. I'm guessing you're using two second loops? If so, have you considered using the 'on "(tag)" ended' condition? I also have a hunch that the order of the every X seconds in the event might cause issues: does "on X seconds | Var = Y" always do the same as "Var = Y | on X seconds"?

    2) Is the audio sample that doesn't play random, or is it always the same one(s)? If the latter is the case, have you checked that all the audio samples work and, if you're relying upon them being the same length, that they are so? I've had situations where I've been checking a sound after a given duration presuming that it's exactly X seconds when it's been a fraction over, throwing everything out of sync. Btw, using round(1,8) means that the values 1 and 8 will be chosen half as often as the other values; floor(1,9) would give you an even distribution.

    Edit:

    I'd be inclined to ditch the function "On Play_background_music" and go for:

    Audio: On Ended "Background_music, bgMusic=0, Current_layout > 0, Music_is_muted = 0 | Audio "music_" & floor(random(1,9) not looping (tag "Background_music")

    ...and then toggle bgMusic when you stop the background music to prevent it looping.

    Edit 2:

    Of course you'd need to trigger the background music to start from somewhere for that to work

  • Sorry, that's not entirely correct - you'll need to make another change:

    Events 4 -6 in your code should be under another main event:

    obj_player is playing "ID_SHOOTING"

    Adding the "trigger once" to Event 2 will prevent the ID_SHOOTING animation from triggering and resetting to normalAttackAnims every tick.

    Adding the new main event means that the code will only check the animation frames while ID_SHOOTING is playing.

  • Looking at the code from the first video, I think your problem may be that the event 2 "Is shooting" condition will trigger every tick until frame 3 is reached. Try adding a "Trigger once while true" to that event - you can combine them rather than making it a sub event but make sure it follows on from the "Is shooting" condition e.g.:

    Event 2: obj_player | Is shooting | trigger once whilst true

    Not:

    Event 2: obj_player | trigger once whilst true| Is shooting

    If you PM me the code I can confirm for you that this is the case.

  • imhotep22

    Cheers! Yes, definitely loads to do .

  • saravanakumar

    Sorry, wish I could help but I don't have any experience porting games to facebook - I hope you get a response though.

  • Is it that you want the bullet to spawn from the gun on the detonation frame (frame 1) rather than the 1st frame (frame 0)? If so, you could use something like this:

    1. On shoot key pressed | set playing sprite animation "shoot" from start.

    2 If sprite.animation "shoot" is playing, if sprite.animationFrame = 1 | spawn bullet from sprite at (gun origin).

    You will need to add an origin point at the position of the barrel of the gun on the sprite, where you want the bullet to spawn from.

    A word of warning about spawning the bullet partway through an animation: unless your animation is very quick and short (or you have a deliberately long wind-up phase for your shot) it is best to spawn the bullet at the first frame because otherwise you may be introducing a noticeable lag into the shooting mechanic, which can make the game feel unresponsive.

    If this isn't what you're after please could you link to specific video you're talking about, or include a capx?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi saravanakumar - you're best off opening up a new forum thread on the "How Do I..." board rather than commenting in this one - include a description of the problem, with a capx if possible, and you'll be more likely to get a useful response.

  • kiko2015

    I use this system for randomizing arrays:

    https://www.dropbox.com/s/h8pmfmjgfkvu8 ... .capx?dl=0

    Event 2 just fills the array with stepped data - you can substitute this event for your array data.

  • Hey, thanks stevecameron

    Yeah, it's amazing how much of a difference just adding a little bit of "juice" can make to a game.

  • Hi Youtopize,

    Sorry, I don't know of other ways to handle the 3D data that are compatible with C2.

    Using a JSON 3D array is probably your best bet (unless any kind souls on the forums have an alternative). It really doesn't take that much more time to enter data into a json than it would using a spreadsheet system and it also has the advantage that you can format the data with returns, tabs and spaces to make it more legible and suited to the type of data you're adding. If you want any help with the formatting I'll be glad to assist.

  • Sumyjkl

    That's useful, thanks. I'll look into it, got some ideas what's going on.

  • imhotep22

    Sorry, missed your post :S Thanks for positive feedback, I'm planning on making some upgrades to the game in the near future, lots of ideas swirling around!

mekonbekon's avatar

mekonbekon

Early Adopter

Member since 9 May, 2014

Twitter
mekonbekon has 13 followers

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • x3
    Popular Game One of your games has over 1,000 players
  • Famous Game One of your games has over 10,000 players
  • Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

20/44
How to earn trophies