mekonbekon's Recent Forum Activity

  • Hi bizzy401,

    The link you posted for the capx is contracted - you need to post the full link for us to be able to download it.

    Some things to check before you update the link:

    1) Is your origin point for spr_Room in the top left corner?

    2) This statement...

    spr_Room.X+(0),spr_Room.X+spr_Room.Width-(1920)

    ...means that if a room is 1920px width then your bounding box for the camera is going to run from the left edge to... the left edge. Similar story for the Y axis. I'm pretty sure that's not what you want. I'm guessing you'd have more luck with something like:

    spr_Room.X+960, spr_Room.X+spr_Room.Width-960

    That would centre the camera in a room that was 1920 pixels wide and for wider rooms stop the camera moving 960 pixels from the left and right edges. For the Y axis use 540.

  • Youtopize - I meant to comment on that Double click on the sprite to open the sprite editor, select each animation and in the properties window set the Speed to 0. After that you don't need the stop animation event.

  • If you want to modify this code, increase both instances of the value 160 to reduce the area that the camera will scroll within a zone, and reduce the 0.1 in "0.1*60*dt" to make the camera move slower.

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

  • Try Construct 3

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

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

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

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

  • 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

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

19/44
How to earn trophies