jobel's Recent Forum Activity

  • The example would look tons better if the sprite graphic was more heading toward to screen.

    yes it's hard when this is just temp-art since the angles are not totally what will end up in the game. But I'm trying to get the sprite movement figured out.

    All I really want is to be able to time size growth with movement. And for both of them to be steady. I think lerp is causing a curve in the Set Position, but it kind of works for a deceleration.. so I added lerp to the Set Scale but it doesn't seem to be the same.. of course it isn't the same..so that I think causes the ship size to be off from it's movement.

    Here is the scene so far..still needs a lot of work!:

    (it's all temp art and temp music)

    https://dl.dropboxusercontent.com/u/36234790/CutScene1.1/index.html

  • Is this better??

    https://copy.com/3Ivz1xValXo0

    yes the end is better.. but it is still growing to fast at the beginning of the sequence..

    I appreciate you giving it a shot!

  • yeah it's too fast and the ratio is off.. I feel like the math is wrong because it just doesn't look right. It should look as if the ship were flying toward you.. and currently it looks more like it's just getting bigger.. something is off, but when I tweak the numbers it doesn't change much. I can't get it to grow any slower by changing x * dt.

    I've done exactly what I am trying to do in animation programs.. I just never had to do the math for it.. and really this is just a proof of concept. It may be that I can't do cut scenes like this...although I would really like to... but first I need to know how to automate sprites movements!

  • In my opinion its to short of a way from left to right to increase the size that much.

    5Type

    thanks, I'm thinking the same.. I just don't think I have the math right.. the 2 (size and position) are related..when I change to other values it just gets worse...

  • sorry, watch 1:55 ...that space rock with an engine strapped to it.. it's basically the reverse motion that I want.. it gets smaller and moves slightly to the left.. it's an optical illusion that "pushes it back".

    yeah no 3D games for me just yet! haha

  • sqiddster

    no, this isn't my asset.. it's just downloaded from the web. But I will have art like this in my game. And I'm not treating it like a game asset really, it's for cut scenes.. so it will be totally scripted.

    similar to this:

    watch 1:49

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • what movement type does your player have?

    are you using platform behavior?

  • Hi, I've been working on this a few days now and just can't figure it out. I need another set of eyes..

    The Goal: I have a 2D sprite that is drawn as if 3D. It's a space ship and I want it to fly in, towards the "player's view" as if this were a camera view.

    I am trying to slowly increase the size of the sprite, as I move the sprite towards the right side to give an optical illusion of it coming closer to you.

    the sprite is angled 3/4 view and facing 4 o'clock-ish.

    I start the sprite at 0.1 scale xy: 160,150 then increase size using lerp and dt. While at the same time setting it's position using lerp moving towards 640,350.

    My Problem: I can't get it to look right. And it seems awkward to increase the sprite's position while I'm checking for max size which always equates to the sprite never reaching it's position.

    I've played around with the variables, and I can get it to go in a "straight line",sort of, but I can't slow it down. I feel like I might be going about this the wrong way.

    I've been playing with the last parameter of Set Position's lerp. but it's not making that much of a difference. And if it's set too low I get a swooping effect (since I know lerp can give a deceleration 'look' used that way). So I tried applying that logic to Set Scale but it's not working like I would expect.

    I know this is tricky..can anyone help me identify the variables I need to balance in order to make this look right? (Since I will probably have other sprites drawn at different angles I need to know how to balance growth-rate vs movement.

    Thanks in advance!

    capx

  • this works..

    Hi,

    I don't mean to step on toes but unfortunately Sprite doesn't have a scale expression. So here are the steps to get the effect you want.

    1. Add an instance variable to your sprite, call it "myscale" and give it an initial value of 0.1.

    2. Add an event with the "compare instance variable" condition and set it up as follows:

    Sprite: myscale<1.0
    ---> Sprite: add 1.0*dt to myscale
    ---> Sprite: set scale to myscale

    Note, the first action is the "add to" action under "instance variables" and the 2nd action is "set scale" under "size & position".

    This will need some tweaking to make it happen in one second. As it is now the expression 1.0*dt can be read as 1 per second, but we're going from 0.1 to 1.0 in a second, or just 0.9 in a second. So it should be like this:

    Sprite: myscale<1.0
    ---> Sprite: add 0.9*dt to myscale
    ---> Sprite: set scale to myscale

    Another thing you can deal with if you like is what I like to call over shooting. With this event the end scale will likely be a bit more than 1.0. You can use the min() expression to limit the highest value to 1.0 and set up your event like this:

    Sprite: myscale<1.0
    ---> Sprite: set myscale to min(self.myscale + 0.9*dt, 1.0)
    ---> Sprite: set scale to myscale

    As a final note you can make the duration longer or shorter by tweaking the dt expression.

    half second:

    2*0.9*dt

    two second:

    0.5*0.9*dt

  • Another thing you can deal with if you like is what I like to call over shooting. With this event the end scale will likely be a bit more than 1.0. You can use the min() expression to limit the highest value to 1.0 and set up your event like this:

    Sprite: myscale<1.0
    ---> Sprite: set myscale to min(self.myscale + 0.9*dt, 1.0)
    ---> Sprite: set scale to myscale

    to clarify incase people got stuck like me...

    use "Set value" instead of "Add to" while using the min()

    or you could just easily use the min() expression on the Set Scale, but probably cleaner to have the instance variable have 1.0 when the sprite is at it's 1:1

    thanks R0J0hound

  • sorry! I meant to link that to JJList

    I download the capx link...

  • Burvey re: your capx, if the sprite is not square it will distort. The aspect ratio of width and height cannot increment at the same rate.

    my sprite was 100x60 and grew distorted (flat looking) and then when it approached full size it finally stretched out to normal, but the transition is not what the OP is talking about.

    I'm still looking for the best way to do this.. probably scale? If I find out I will post it here.

jobel's avatar

jobel

Member since 27 Jul, 2013

Twitter
jobel has 8 followers

Connect with jobel

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • x4
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

18/44
How to earn trophies