This site requires JavaScript, please enable it in your browser!
Greenfoot back

MTK's Comments

Back to MTK's profile

MTKMTK

2009/11/8

Nice new functionality! But I find the left-hand control very awkward.
I didn't notice any lagging.
Very good! The letters are just a bit too close but nothing too noticeable, much better then before. Music is nice, too. I see that in the background scene with that puddle there is a sign reading "Warning Sweage". Did you mean Sewage?
I created my own collision algorithm, but I have no idea how to implement rotation it it. norm = norm.unit(); PhysicsObject a = this; Vector2D ua = a.velocity; Vector2D ub = b.velocity; Vector2D uab = ua.subtract(ub); if(uab.dotProduct(norm) < 0) { double e = (a.elasticity + b.elasticity) / 2; double f = Math.min(a.friction, b.friction); Vector2D tang = norm.perpendicular(); Vector2D uaNorm = ua.projectOnto(norm); Vector2D uaTang = ua.projectOnto(tang); Vector2D ubNorm = ub.projectOnto(norm); Vector2D ubTang = ub.projectOnto(tang); Vector2D vaNorm = elasticCollision(uaNorm, a.mass, ubNorm, b.mass, e); Vector2D vbNorm = elasticCollision(ubNorm, b.mass, uaNorm, a.mass, e); Vector2D inelasticVTang = inelasticCollision(uaTang, a.mass, ubTang, b.mass); Vector2D vaTang = inelasticVTang.scale(f).add(uaTang.scale(1-f)); Vector2D vbTang = inelasticVTang.scale(f).add(ubTang.scale(1-f)); a.velocity = vaNorm.add(vaTang); b.velocity = vbNorm.add(vbTang); } I wonder if a solution would be to have a method that applies an impulse to a certain point on the body or something?
Yes, I did see it. I am trying to figure out collisions with friction, now.
MTKMTK

2009/11/8

I just thought that the character moves quite slow, whether it is a glitch or you made it that way.
MTKMTK

2009/11/8

Seems to me that you should make it faster, because the guy walks really slow and stays invincible for quite a long time after he hits spikes.
That's really cool! But it would be nice if I could spawn plant/fire at the location of the mouse, and not just below the funnel, too.
I found some site that explained collisions a little bit, and the formula from there is used here: http://www.myphysicslab.com/collision.html But it doesn't say anything about friction, and I don't completely understand it :( Oh, and the blue ball is twice more massive then the red one, I forgot to say that in the description.