Results 1 to 10 of 35

Thread: Some gravity particles

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #28
    Remember there were originally 2 multiplications in optimized version, so now it becomes 1 and that looks like working well
    Code:
    d:=G_FORCE/(d*d);
    I still want to give boundaries to the world though, and see what it'd be like. Kind of like how subsection would settle, and i expect a little plasma-like effect. Some days later perhaps.

    edit: Decided to code them straight away. (No plasma, but something more boring )
    Code:
                // Rectangular collision
                {if v.x<-10 then movement.x:=abs(movement.x)
                else if v.x>10 then movement.x:=-abs(movement.x);
                if v.y<-10 then movement.y:=abs(movement.y)
                else if v.y>10 then movement.y:=-abs(movement.y); }
                // Circular collision
                if v.x*v.x+v.y*v.y>100 then
                  movement:=reflect(movement, vector2f(-v.x*0.1,-v.y*0.1));
    Attached Images Attached Images
    Last edited by User137; 21-06-2013 at 07:25 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •