ScratchData LogoScratchData
Back to ProdigyZeta7's profile

Waypoint AI

PRProdigyZeta7•Created June 6, 2013
Waypoint AI
29
22
669 views
View on Scratch

Instructions

Click to create a waypoint that the AI car will drive to. Space to create 5 random waypoints. Adjust the sliders to change the way the car drives.

Description

This car automatically drives! It goes to each waypoint in order! What's different about this is that it does NOT use the point towards block! It actually turns towards a point rather than point immediately to it! I don't know exactly how I did it, but by chance I made the formula for DeltaTurnVelocity = cos(myDirection)*sin(idealDirection) - cos(idealDirection)*sin(myDirection) where the ideal direction is the direction the car would face towards the point. Amazing, right? I'm using it for a racing game that uses waypoints that I'll upload in just a while!

Project Details

Project ID10698563
CreatedJune 6, 2013
Last ModifiedAugust 23, 2013
SharedAugust 23, 2013
Visibilityvisible
CommentsAllowed