mekonbekon's Forum Posts

  • Sure, here you go! The style is (ahem) charmingly simple

    Main splash:

    Story:

    Gameplay:

  • ,

    Whichever behaviour you're using, it'd be worth familiarising yourself with the 'clamp' expression - it's very useful for a bunch of situations in which you want to constrain a variable between a minimum and maximum value.

    It takes the form clamp(value, max, min). The handy thing is that the 'value' part can be a variable or expression itself. So in your case, for example you might have a 'speed' instance variable on Mario. You could then use the following code:

    On right arrow down: Set Mario.speed to clamp(self.speed+1,-10,10); Set Mario.X to self.X+self.speed

    On left arrow down: Set Mario.speed to clamp(self.speed-1,-10,10); Set Mario.X to self.X+self.speed

    This would increase or decrease Mario's speed by 1 each tick depending upon which direction key is held down and then move Mario in the given direction.

    Remember to reset the speed to 0 when no key is pressed, or divide the speed each tick after release to allow deceleration.

    Alternatively check out the 'max' and 'min' expressions in the manual - they can be used in a similar way to limit the range of a variable.

    You should also familiarise yourself with using dt time to ensure frame rate independent movement - there's a bunch of tutorials, forum posts and manual entries on how to use it - a quick search should point you in the right direction.

  • LaurenceBedford

    This is the basic idea:

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

    The code I discussed above is in Event 2; the rest of the code is only there to get the cars moving.

    You can make the positioning more accurate by adding more trackSections in.

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

  • Don't know how NG is exactly handling the games, but if it lets you upload an update to your game by the new end date that will be fine.

    Tom thanks for clarifying

  • I've already submitted my entry, but would like to make use of this extension to add a few tweaks; will I be able to resubmit without any hitches?

  • In fact the track section sprites don't need to be touching, as long as each spans the width of the track and they're deep enough to register a car passing at speed i.e. the car isn't moving further than the depth of the section in a single tick.

  • Hi LaurenceBedford, assuming you have a looped track, this might work, haven't tried it out yet though:

    Create a sprite object called "trackSection" and give the object two instance variables called "position" and "sectionNo" Place instances of this sprite contiguously around the track setting sectionNo=1 to the first section and stepping up by one for each subsequent section. You can set the sprites invisible.

    Give your cars instance variables of "sectionNo" and "position" as well, starting both on 0.

    Use this code:

    If car is overlapping with trackSection & car.sectionNo<trackSection.sectionNo, trigger once:

    set trackSection.position to self.position+1

    set car.position to trackSection.position

    set car.sectionNo to trackSection.sectionNo

    As each car passes over the section it tags itself with the current position value of that section which steps itself up for the next car. Tagging the car with the current section number and checking to make sure that it's less than the current section that its on prevents bugs from the cars backtracking into a previous section.

    Essentially what you're doing is running a sequence of small races and check the winner for each section. You want to keep each section fairly small so that it captures place changes quickly.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi Fradno , in addition to imhotep22 's comment:

    1) Try some experiments: reduce the image size of the object or simply remove the object, run in debug and see what impact that has on the performance. Save these experiments as different names so you don't mess up your original project. Use information on the debug Profile tab to identify which areas of code are hitting the CPU hardest.

    2) Export the project and have a look in the images folder - you can get an idea how the images are being laid out on the spritesheets and it might give you an idea which ones can be reduced in size slightly to optimise memory usage.

    3) Read through these if you haven't already:

    https://www.scirra.com/blog/112/remembe ... our-memory

    https://www.scirra.com/blog/83/optimisa ... -your-time

    https://www.scirra.com/manual/134/performance-tips

    https://www.scirra.com/blog/87/under-th ... onstruct-2

  • 3DPiper Thanks for letting me know. Just checked and I appear to have the same problem as you with the Newgrounds link on my Nexus 5X, but this:

    http://c3gamejam.bitballoon.com

    ...is the same export as I've uploaded to Newgrounds and works fine on my phone. Weird.

  • Triple Triple Bagels, to be precise: my entry for the C3 Jam <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    http://www.newgrounds.com/portal/view/694045

    Do you like bagels?

    Can you stick food on a spike?

    Do you enjoy working for tips?

    Does the risk of possible prosecution due to unsanitary premises excite you?

    Yes?! Then come and join Triple Triple Bagel Pop-up, where the hours are long, conditions are cramped and the staff turnover stratospheric! All the triple bagels you can eat and not much else!

    Instructions:

    Flick the fillings onto the stacks and serve hipsters their bagel orders: be quick, be right, earn big tips.

    Please vote for my game and free it from Judgement Purgatory!

  • khelaghor

    You're welcome

  • khelaghor

    An extra tip: to enhance the sense of depth add a ball shadow sprite that scales at the same rate as the ball and matches the ball's X value and Ymax value. Fade out the shadow based upon the ball's current scale (bigger scale, more faded shadow)

  • khelaghor

    Add an instance variable to the ball called Ymax and give this the highest Y value that the ball reaches (e.g. if you kick the ball at Y= 400 then Ymax = 400)

    Add an instance variable to the ball called scaleFactor and give this the value the maximum increase by which you want the ball to scale (e.g. if you want the ball to scale to 1.5 its size then scaleFactor = 0.5)

    Every tick set ball scale to 1+(1-ball.Y/ball.Ymax)*ball.scaleFactor

  • yuji567

    There are three different techniques I often use to make smoothly scrolling backgrounds/floors on a loop, depending upon what the project requires. Assuming right-to-left movement:

    1) Use two instances of the same sprite the width of the screen and wrap them around each other

    2) Use one instance double the width of the screen

    3) Use a tiled background one tile larger than the width of the screen

    I've demo'd each here:

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

    The main thing is to reposition with respect to the current X, otherwise you can start to get seams and stutters in the scrolling.

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

  • imhotep22 cheers I just noticed that my link was automatically contracted! D'oh!

    JoshSenpai It should look like this:

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