mekonbekon's Recent Forum Activity

  • You're welcome

  • One thing to note when using angles: when you look at sprite in the editor, 0 degrees actually points to the right rather than straight up, so you need to take this into account when using things like the angle(X1,Y1,X2,Y2) function. Check out how I've set up the hippo sprite and its origin in the editor to see what I mean.

  • Hi the_Shit_hawk (nice username - Lahey would be proud! <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile"> )

    I wasn't exactly sure what you were after so I've included two schemes in this demo:

    https://www.dropbox.com/s/umqh6cnvtwuh3 ... s.c3p?dl=0

    Just re-enable the second event and disable the first to switch.

    I've set the hippo to invisible rather than destroy it, which should be a teensy bit faster at runtime - you would probably want to disable the collisions when it's invisible too.

    Hope that helps! <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

  • Yeah, maybe a bug then - does it work properly in C2?

  • stevecameron

    Nice start! Maybe add in a collectable object for a score bonus? That would introduce a nice risk-reward mechanic. A couple of other suggestions for simple improvements would be to include an in-game timer so that player has an indication of their progress, and a death animation on the avatar. Looking forward to your next creation!

  • Have you tried "Set Canvas Size"? If you then want the pixels to scale correspondingly you can set the Layout scale.

  • I'm glad that the preloading worked for you - if it takes too long to load you can break up the preloading of sounds into groups using the preload action at the start of the different layouts rather than preloading them all at the very beginning.

    Thanks for sharing the link, the game is looking good - nice work!

  • Hmm...

    I set up a test demo but couldn't replicate the bug.

    A couple of other thoughts:

    1) Are all the sounds preloaded?

    2) Have you tried spitting out some debug text to check whether (i) the event isn't triggering, (ii) the audio action isn't triggering, or (iii) the audio event is triggering but no audio is playing? You could do this by including an action in the event playing the audio that adds the current time to a text object. If there are gaps in time sequence then it must be the case that the event isn't triggering, but if the time is always added then you know that the event triggers ok, so it must be an issue with either case (ii) or (iii), in which case you can run the game in debug, select the audio object and watch it - if the object registers as playing when you get the bug then (iii) is the cause, otherwise it's (ii).

    Apart from that I'm stuck too, sorry I couldn't be of more help :S

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • imhotep22

    Cheers! Yes, definitely loads to do .

mekonbekon's avatar

mekonbekon

Early Adopter

Member since 9 May, 2014

Twitter
mekonbekon has 13 followers

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • x2
    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
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

18/44
How to earn trophies