Top-down surface friction demo

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
Azhukar
Party member
Posts: 478
Joined: Fri Oct 26, 2012 11:54 am

Top-down surface friction demo

Post by Azhukar »

Box2d friction joints used to emulate top-down friction. Works even with mobile surface bodies.
Attachments
SurfaceFriction.love
Control with WSAD.
(2.46 KiB) Downloaded 772 times
integralsleeper
Prole
Posts: 3
Joined: Sun Apr 13, 2014 10:22 pm

Re: Top-down surface friction demo

Post by integralsleeper »

This is very awesome.

I am wondering if there is a way to look at the source from a .love file. I am new to this, but would like to learn as much as I can. This would be great for a top-down racing/driving game.
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: Top-down surface friction demo

Post by davisdude »

Change the extension from a .love to a .zip, then you can view it as a normal .zip file.
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
luaiscool
Prole
Posts: 34
Joined: Mon Apr 21, 2014 11:03 pm

Re: Top-down surface friction demo

Post by luaiscool »

Hope you see this!

I was wondering if I could use your code for turning like how you rotated then went forward. I wanted to use that code for something I'm making. I'm not sure if I'll share it on here but if I do I'll give you credit in code and in the game :) Great idea too!
http://xkcd.com/979/

Code: Select all

if signature = true then
    print(signaturetext)
else
    print("Error: Signature Not Found")
end
luaiscool
Prole
Posts: 34
Joined: Mon Apr 21, 2014 11:03 pm

Re: Top-down surface friction demo

Post by luaiscool »

On second thought, Took a look through your code and I've realized it much harder the way you set it up because you wanted to make that section orientated to your "game" thing so is there a chance you can message me or give me a bit of help on how to do that? If so that would be great thanks :)
http://xkcd.com/979/

Code: Select all

if signature = true then
    print(signaturetext)
else
    print("Error: Signature Not Found")
end
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: Top-down surface friction demo

Post by davisdude »

Sure! You can use it! I'll show you the important parts:

Code: Select all

Direction = math.atan2( ( ObjectY - TargetY ), ( ObjectX - TargetX ) )
Then you set that as the direction. Good luck!
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
luaiscool
Prole
Posts: 34
Joined: Mon Apr 21, 2014 11:03 pm

Re: Top-down surface friction demo

Post by luaiscool »

davisdude wrote:Sure! You can use it! I'll show you the important parts:

Code: Select all

Direction = math.atan2( ( ObjectY - TargetY ), ( ObjectX - TargetX ) )
Then you set that as the direction. Good luck!
I'm very confused is it alright if I put this up on media fire and you can download it and give me some help?
http://xkcd.com/979/

Code: Select all

if signature = true then
    print(signaturetext)
else
    print("Error: Signature Not Found")
end
User avatar
Sodium
Prole
Posts: 42
Joined: Sun Jun 03, 2012 9:05 pm

Re: Top-down surface friction demo

Post by Sodium »

I tried to make a box2d car game once, but yours is way better.
Attachments
box2dCar.love
press rmb to add trees
(57.36 KiB) Downloaded 226 times
I love okra. :P
Post Reply

Who is online

Users browsing this forum: No registered users and 82 guests