Verlet Physics Demo

Talk about making games.

Verlet Physics Demo

Postby kirby » Fri Dec 19, 2008 3:39 am

Hi people in Ged forum i've been while not online, though.....
Here my example of verlet..... Sorry i made a mistake that i deleted the source.
This isn't a good one because i don't know how to draw a line to another point.

While i dunno if anyone know what is verlet physics. :D
I wanna make it better but theres less functions for me to operate just a single instances.
-Like collision on same instances.

Ah i posted the source..... :?
Attachments
pts.zip
Source.
(198.04 KiB) Downloaded 93 times
asd..PNG
Verlet Physics Test.zip
Demo Version 0.1
Unzip using WinZip.
(753.68 KiB) Downloaded 115 times
Last edited by kirby on Sat Dec 20, 2008 4:30 am, edited 2 times in total.
kirby
 
Posts: 121
Joined: Wed Nov 14, 2007 3:32 am
Score: 6 Give a positive score

Re: Verlet Physics Demo

Postby pyrometal » Fri Dec 19, 2008 4:17 am

Very good demo Kirby, your physics are really good! It sure has been a while since you've been on the forum (like you said). To draw lines, you can use a large canvas with the functions moveto(x,y); and lineto(x,y);. You can set the line color/size/transparency by using setpen(r,g,b,t,p); Good luck!

--pyro
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Re: Verlet Physics Demo

Postby kirby » Fri Dec 19, 2008 4:55 am

:cry:
>,< Can't get to work, when it draws, it stupidly draws from the origin of the canvas(0,0)..... Even i used moveto(x,y);
And how do i refresh the canvas that it just keep drawing more lines until the screen on left corner goes dark.....
:shock:
kirby
 
Posts: 121
Joined: Wed Nov 14, 2007 3:32 am
Score: 6 Give a positive score

Re: Verlet Physics Demo

Postby pyrometal » Fri Dec 19, 2008 5:50 am

You have to use moveto(x,y) before anything else, and also use erase(0,0,0,1); to reset the canvas to transparent(before drawing). Everything the canvas has to do should be in it's "draw actor" event in order to refresh every frame. Hope this helps solve some of your problems...
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Re: Verlet Physics Demo

Postby kirby » Fri Dec 19, 2008 3:04 pm

Ok thanks now i get it to work.....
kirby
 
Posts: 121
Joined: Wed Nov 14, 2007 3:32 am
Score: 6 Give a positive score

Re: Verlet Physics Demo

Postby zygoth » Fri Dec 19, 2008 6:04 pm

This is really cool! This would be great to use in games. If you can, I would love to see the source code if you can remake it. I almost never use canvases though so I cant help you there, sorry.

Zygo
Nova: 100% Vertigo/Mazeman: 100%
Visit my website to download them both! http://www.ketonegames.com
User avatar
zygoth
 
Posts: 140
Joined: Mon Jun 11, 2007 6:37 pm
Score: 5 Give a positive score

Re: Verlet Physics Demo

Postby kirby » Sat Dec 20, 2008 4:26 am

Here the source or from the top. Some stuff explains..... :lol:
[][][][][][][][][][] \/\/\/\/\/\/\/\/\ /\\//\\//\\//\\// {}{}{}{}{}{}{}{}{}{} -_-_-_-_-_-_-_-_- ()()()()()()()()()()
[[]][[]][[]][[]][[]] {{}}{{}}{{}}{{}}{{}} (())(())(())(())(()) |_|_|_|_|_|_|_| 0o0o0o0o0o0o0o
:D :) :( :evil: :twisted:

...This game-editor forum board is bad, i always have to relogin after a while, thats annoying.
:? My Game Site: www.freewebs.com/kei10/index.htm
Attachments
pts.zip
Source
(198.04 KiB) Downloaded 87 times
kirby
 
Posts: 121
Joined: Wed Nov 14, 2007 3:32 am
Score: 6 Give a positive score

Re: Verlet Physics Demo

Postby Azou » Tue Dec 30, 2008 1:38 pm

Well done,Kirby! :mrgreen:
User avatar
Azou
 
Posts: 514
Joined: Thu Sep 13, 2007 1:12 pm
Score: 35 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest