Train Ride

A little demo I made. More to come later

PDF
https://www.dropbox.com/s/7gforg97kqy9uku/Train.pdf

DocX
https://www.dropbox.com/s/5h5bj280aqxx7g9/Train.docx

@coder this is a really nice little project teaching many things. Thanks for sharing.

@dave1701 & @Jmv38 & @TheSolderKing & @MrScience101 thanks for the nice comments guys

@Coder Nice little example. Reminds me of a roller coaster.

@dave1707 thanks. Maybe I could make it into a roller coaster with more cars and stuff

That’s really neat. My kids called it a choo choo train :). Where did you learn how to use physics? Is there a good tutorial out there?

@MrScience101 - I’ve written about physics in my Codea ebook and in a number of blog posts, but you can judge whether they are any good!

http://coolcodea.wordpress.com/2013/06/19/index-of-posts/

@ignatz, I consider anything you write as golden nuggets of knowledge.

@Ignatz your tutorials are great and clearly explained how to use physics. Thanks!

Update: carriages
@MrScience101 even more like a train now

That is amazing! I always have trouble with physics. How did you connect the cars? Edges? :-?

@TheSolderKing, without taking a closer look at the code it’s hard to say, but likely they are connected using joints.

Yes, i use distance joints like this:

physics.joint(DISTANCE, car.body,trailers[1].body,vec2(car.body.x-90,car.body.y),vec2(trailers[1].body.x+40,trailers[1].body.y),120)

@TheSolderKing Igntaz has some great physics tutorials here:
https://coolcodea.wordpress.com/category/physics-2/page/2/

Now the code is in a PDF because it was getting too big. Look at the first post