Jump to content
Search Community

technob

Members
  • Posts

    3
  • Joined

  • Last visited

technob's Achievements

1

Reputation

  1. We are using a combination of TweenMax and Scroll Magic to Achieve the car moving on the Road effect Here is the fiddle I've created, if a code pen is different to this in someway I can create one of these also, please let me know. Car movement fiddle If you scroll down the road and then scroll up just a little bit, you will notice that the car continues its journey down the road but in reverse. This is because the orientation of the car is linked to the last scroll direction of the mouse. We would like to make the following function to improve the way the car drives on the website. I’ve used Psudo Code as I think the logic I have in mind is correct I just don’t know the right commands/functions/syntax. Of course if anyone has a more elegant suggestion I’m all ears. (See how the car interacts when changing direction on http://rit-team.ru/ ) Var CarDirection = “S” - Vehicle direction is set to south Upon Mouse Scroll() { VehicleYPosition = Get Current Object Position() // This is the current location of the car on the page. even if it is mid tween. ScrollYPosition = Get Current Scroll Position() // This tells us where the scroll is currently on the page. I know this relates to scroll magic but if you can advise on this too it would be really appreciated. If MouseScroll = Up AND CarDirection = “S” AND VehicleYPosition + 20 < ScrollYPosition{ Stop Current Tween () RunFigure8 Tween (CarDirection) // this would consist of using the car’s current position and direction to drive in a figure 8 motion to turn the car around (see http://rit-team.ru/) CarDirection = “N” // Change the orientation of the car RunRegularTweenFunction() // The car will then continue driving to the correct scroll location } If MouseScroll = Down AND CarDirection = “N” AND VehicleYPosition - 20 > ScrollYPosition{ Stop Current Tween () RunFigure8 Tween (CarDirection) CarDirection = “S” RunRegularTweenFunction() } Thank you all in advance...
  2. You're a diamond! Thank you so much. Sorry if this posted in the wrong place. Where should I be asking this question, as I imagine I will have some follow up queries to tweak the script further. I'll also get a CodePen Demo created after i've played some more with the settings.
  3. Hey, I'm trying to make a change to a tween max script but I'm a bit out of my depth. I've got a cool road script going on but the car does not flow very naturally. Here is my site. http://technobuffs.co.uk/dev/tpz/ (scroll down and you will see the timeline road) The car moves in connection with the scroll but if you compare it to: http://rit-team.ru/ Here you can see the car moves in connection with the scroll too but it is not directly tied, it accelerates, decelerates and has a maximum speed, even if the user scrolls quickly. My code is below. What sort of changes/additions do i need to be making in order enhance the way the car drives. Many thanks for any help.
×
×
  • Create New...