mekonbekon's Recent Forum Activity

  • Hi ,

    Looking at the video, this code is firing every tick whilst the player is overlapping a zone sprite (in fact you don't need the "every tick" condition, just checking for the overlap should trigger every tick). Whenever the player sprite moves over a new zone sprite it repositions the camera using lerp to ensure a smooth transition.

    Breaking the code down:

    lerp(a, b, x) is the linear interpolation of a to b by x. X is usually a value between 0 and 1 representing the percentage of the distance between a and b to travel.

    clamp(i, lower, upper) returns lower if i is less than lower, upper if i is greater than upper, else return i. This is a handy expression to restrict the range of a variable.

    So in this example, every tick the camera scroll position will move 0.1*60*dt (about 10) percent of the distance from the current camera scrollX position(a) towards the Player.X position(i), limited by the clamp expression to between 160 pixels from the left(lower) and right(upper) of the current zone, so if the player moves outside of that area the camera won't scroll any further until the player moves into the next zone.

    If the player changes direction and reenters the central area of the zone then the camera will start to follow them again.

    Hope that makes sense!

  • alonesia You're welcome

  • SoldjahBoy

    Yeah, not so straightforward... time to put the thinking cap on...

  • Youtopize

    Here's an update to the capx showing what I mean:

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

  • Try Construct 3

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

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

    The easiest way to achieve this would be to have one image sprite and then store all the images as frames on that one sprite.

    Give the sprite two animations, one for feedbackA and one for feedbackB, and add the relevant images to those animations: keep the frames in order of the questions.

    That way all you need to do is set the frame on the image sprite to the current question and switch the animation depending upon which answer was selected - no need to add extra data to the array, because you're just using the existing data to switch the state of the image sprite.

    You could even add an additional animation to show an image before feedback is selected.

  • Hi ,

    I'm having trouble understanding your diagram.

    Do you want the gun to rotate a minimum of 5 degrees if a button is tapped, but if the button is held then keep rotating until the gun is at 270/325/0/35 degrees?

  • alonesia

    1) Click on The File tab.

    2) Select the Preferences button (bottom right of the pop-up window).

    3) In the General tab you can change the Event sheet font in the "Event sheet view" box by clicking the "Change..." button - mine is set to Segoe UI 11pt

    Hopefully that will work

  • markuzz78 I'm really baffled by this issue...

    I've gone through your capx and modified everything so that our capx have the same settings and objects, yet the issue persists in your capx but not in mine.

    You can compare the two capx's:

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

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

    The only thing I can't account for is whether we are using different versions of C2 to make the initial project - I'm on 244, how about you?

    I know you've got a workaround from MPPlantOfficial (phew!), but could I make the suggestion of creating a completely new project using the same settings as mine and seeing if the problem still occurs? Should only take a couple of minutes and at least it would allow us to identify whether or not it's just something weird going on in the original capx.

  • Hi matriax,

    I couldn't find a way to make the sprite rotate once it had been set using the "set cursor from sprite" action, but I did manage this workaround, if it's of any use:

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

  • Hi dmt90001

    If you want to change all the 1 seconds to 2 seconds:

    1) add a global variable spawnTime and set it to 1.

    2) replace the "1.0" in each "every 1.0 seconds "so that it reads "every spawnTime seconds".

    3) on power-up collected change the value of spawnTime from 1 to 2.

  • tarek2 - much simpler than mine, good call!

  • Turaco You could do something like this, using the Zindex for each sprite:

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

    It starts to get a bit complex if you have multiple sprites - you may have to shift the overlap check into a function and pass the UIDs.

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