2 sprite for shadow

0 favourites
  • 8 posts
From the Asset Store
- This pack is suitable for shooting games, running games, platform games, and side-scrolling...
  • hi all,

    i have a simple 2 problem :

    first of all i have 2 sprites these sprites one of them is the player (physic,platform) i want the 2nd sprite to pin behind the player and it keeps getting longer back when the player move faster like in cars and shoadows or like that (i don't know how they call it in english)

    see picture of what i want to do:

    <img src="http://i50.tinypic.com/2wcofvn.jpg" border="0">

    2nd problem how can i make it when player stop it keeps getting small until it comes to sprite size

    last things i can do it later . to make this thing work when i jump or fall also make this shadow with opacity 50 or like this

    see the capx :

    http://dl.dropbox.com/u/67034121/forum/shadow.capx

  • First problem:

    Well, from what I know of physics, shadows do not get longer when an object is going faster...

    Anyway, are you saying the player uses physics and platform behaviors? That's a sure way to depression... Choose one or the other.

    Anyway, if you want to ignore the laws of optics ;)

    To get the speed, use distance(0,0,vectorX,vectorY) - it will be slightly different for physics or platform. Then multiply this and some factor by the shadow.width or height, and add a value. This added value will be the size that it goes to at speed zero.

    So your formula will be: set shadow.width to:

    distance(0,0,vectorX,vectorY) * factor + base_size

  • sqiddster

    i tried it but it stucked , i don't know in platform when i click right it get bigger without the speed, and in physic it works fine but still this isn't the point i want like this picture :

    <img src="http://i45.tinypic.com/2e4emwx.png" border="0">

    if you wanna see what i have done see capx :

    http://dl.dropbox.com/u/67034121/forum/shadow%20fail.capx

  • I believe in english that's called a trail

    trail2.capx (you can play with randomness values if you want.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • EDIT: Ooh, you want a trail...

    Yann's example is probably what you are after.

    Firstly, what you are intending is in no way how a shadow should look. Why do you want to do this? What is the shadow even falling on?

    Also, you need to choose either physics or platform, you must not use both. If you are making a platform game, you should use platform.

    If you tell us these things, it will be a lot easier for us to help you.

  • I can think of a real application of this--I'm trying to do something similar with dust particles in a platformer. The faster the player goes the further I want the dust particles to trail out behind. I'm no physicist, but this seems intuitively correct since the player has covered more distance in the time it takes for the dust to fall to the ground.

  • sqiddster , thanks for your big help ^^ and sorry again (i have said in the topic i don't know what they called XD )

    Yann , thanks for your help this is exactly what i was looking for .

  • kittiewan

    smoke doesn't move faster, smoke is just feet (if you have a running character) or wheels (if it's a vehicle) that creates local air movements and that makes dust fly up... So the faster you go, the more dust smoke you would produce, but the dust doesn't move that much, it just goes up and then fall on the ground.

    There's not that much dust going horizontally unless there's a strong friction (like a car stuck in the sand or something like that)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)