HOME | DD

Published: 2006-09-21 15:07:13 +0000 UTC; Views: 5598; Favourites: 20; Downloads: 89
Redirect to original
Description
Test of multiple collisions against particlesRelated content
Comments: 32
NinjitsuWarrior In reply to NinjitsuWarrior [2007-05-28 09:37:22 +0000 UTC]
Oh ok, do you have a newgrounds account?
👍: 0 ⏩: 0
DCLeadboot [2007-04-26 12:57:54 +0000 UTC]
Cool special FX!
It would make a great rain/snow/hail effect with the right graphics!
👍: 0 ⏩: 0
ZaneAsylum [2006-10-13 14:27:59 +0000 UTC]
This very very cool...If I knew how to use this code *I saw your formula and I don't know...pretty advanced stuff for me personally* but if I could do it...i would use this effect to have the cursor as a movie clip of Pegasus and turn the blocks into droppings and have the circles as frowning heads...I apologize for that visual but my small mind thinks like that again nice coding on that ...works perfectly
👍: 0 ⏩: 1
Supa-Monky In reply to ZaneAsylum [2006-10-13 14:49:36 +0000 UTC]
You do know that im gonna have to make that now
👍: 0 ⏩: 2
ZaneAsylum In reply to Supa-Monky [2006-10-13 15:02:04 +0000 UTC]
DUDE I thought of a great name for it...if you do this Pegasus + Fiber = FUNNN XD!!!
👍: 0 ⏩: 1
Supa-Monky In reply to ZaneAsylum [2006-10-13 15:05:31 +0000 UTC]
So when are you gonna do teh gfx?
👍: 0 ⏩: 1
ZaneAsylum In reply to Supa-Monky [2006-10-13 15:06:20 +0000 UTC]
lemme do the Pegasus real quick and I will ...er...what Flash version are you using?
👍: 0 ⏩: 1
ZaneAsylum In reply to Supa-Monky [2006-10-13 15:08:11 +0000 UTC]
ok...lemme make it and then I can upload the parent file and you can work your magic with it
👍: 0 ⏩: 1
Supa-Monky In reply to ZaneAsylum [2006-10-13 15:10:03 +0000 UTC]
Ok, but you want be able to see it till tommorow or later today or somthin depending where you live... its 1:08AM in australia... and i need sleep
👍: 0 ⏩: 1
ZaneAsylum In reply to Supa-Monky [2006-10-13 15:10:47 +0000 UTC]
ok no rush...i just hope you can make it happen cuz if you can it will be soooo friggin cool
👍: 0 ⏩: 1
Supa-Monky In reply to ZaneAsylum [2006-10-13 15:12:23 +0000 UTC]
Well i do make alot of pointless game but i will make this for sure and any other game you can think of
👍: 0 ⏩: 1
ZaneAsylum In reply to Supa-Monky [2006-10-13 15:12:59 +0000 UTC]
well im not much of a thinker but if i get an idea i will for sure send it your way
👍: 0 ⏩: 1
ZaneAsylum In reply to Supa-Monky [2006-10-13 14:50:21 +0000 UTC]
YOU NEED TO!!!! oh man that would rock...I am telling you!
👍: 0 ⏩: 1
Supa-Monky In reply to ZaneAsylum [2006-10-13 14:58:03 +0000 UTC]
Would you be willing to do the gfx?
👍: 0 ⏩: 1
ZaneAsylum In reply to Supa-Monky [2006-10-13 14:59:15 +0000 UTC]
what you mean the Pegasus and the frowning people? sure! But your a good enough artist...you did your own avatar right?
👍: 0 ⏩: 1
Supa-Monky In reply to ZaneAsylum [2006-10-13 15:03:29 +0000 UTC]
yeah, but i dont know how draw a pegasus, and it would be a change to get somone else to do gfx for a while
yeah its my avatar, it rocks
👍: 0 ⏩: 1
ZaneAsylum In reply to Supa-Monky [2006-10-13 15:04:54 +0000 UTC]
yes see your avatar is a great example of your drawing ability...ok so you want a cartoony Pegasus MovieClip?
👍: 0 ⏩: 0
Aspherin [2006-09-21 23:41:21 +0000 UTC]
damn that's cool..mindif i ask how you went about coding it?
👍: 0 ⏩: 1
Supa-Monky In reply to Aspherin [2006-09-22 00:25:13 +0000 UTC]
Well for starters i like to test basic collision between the particles useing hitTest then after that you need to get the x and y distance
xd = particle._x - circle._x
yd = particle._y - circle._y
after that you can get the distance and direction
distance = Math.sqrt(xd*xd+yd*yd)
direction = -Math.atan2(xd,yd)/(Math.PI/180)
then you ask if the distance is less then the radius of the circle (if circle on circle collision use both radius's combined)
if the distance is less or equal (< then we go
particle._x = circle._x+(Math.cos((direction+90)*(Math.PI/180))*radius
particle._y = circle._y+(Math.sin((direction+90)*(Math.PI/180))*radius
the code above makes it so the particle cant pass through the circle, so it sets its position relitive to its direction
then you have to set new velocities to the particles
(i useually have to stuff around for a while to get what i want because i dont learn physics at school yet :[ )
for this i made the particles y velocity just bounce
yv = -yv*0.5+2 // y velocity = -y velocity * bounce + weight
and i tryed to make some of the y vecocity transfer into x velocity
xv = (Math.cos(dir+90)*yv)*0.5
if you need more help just ask, i know alot of formulas
👍: 0 ⏩: 3
ssjskipp In reply to Supa-Monky [2007-08-02 15:02:54 +0000 UTC]
That's how I figured you did it...so I assume each particle is running a for..in loop, cycling through alll the circles on the map? Or is it the circles that are running the loop (if the loop even exists)?
Oh, and: AS2, right?
👍: 0 ⏩: 1
Supa-Monky In reply to ssjskipp [2007-08-02 22:56:02 +0000 UTC]
yeah this ones only AS2 one of the first physics things i ever made, each particle just cycles though a list of all the collidable objects and test collisions
👍: 0 ⏩: 0
JohnJensen In reply to Supa-Monky [2007-03-18 20:08:25 +0000 UTC]
ARRRRRGHHHH.. genius code 8D
👍: 0 ⏩: 0
Aspherin In reply to Supa-Monky [2006-09-22 01:32:50 +0000 UTC]
wow...lol..that's a long reply
thanks
👍: 0 ⏩: 1