Search Results

Search found 2 results on 1 pages for 'mcjohnalds45'.

Page 1/1 | 1 

  • Reacting to rectangle on rectangle collisions

    - by mcjohnalds45
    I don't know how to react to collisions between two axis aligned rectangles that have x, y, width and height values (x and y are from the centre of the box) to make them simply not overlap. I figured I'd just make them move away from each other depending on how far they intersect in the opposite direction (left, right, up or down) of where they collided. If I check for collisions only on the x axis or only on the y axis it works fine, but when checking for both collisions crazy stuff happens. This code executes when the first box collides with the second. It's in lua but feel free to answer in anything that isn't to too counter-intuitive. if box1.x < box2.x then box1.x = box1.x + box2.x - box1.x - (box1.width / 2) - (box2.width / 2) end if box1.x > box2.x then box1.x = box1.x - (box1.x - box2.x - (box1.width / 2) - (box2.width / 2)) end if box1.y < box2.y then box1.y = box1.y + box2.y - box1.y - (box1.height / 2) - (box2.height / 2) end if box1.y > box2.y then box1.y = box1.y - (box1.y - box2.y - (box1.height / 2) - (box2.height / 2)) end

    Read the article

  • I don't have permission to access other drives

    - by mcjohnalds45
    After messing with the user accounts & names, I found I can't access my external drives without using sudo. So when I access one normally with cd "/media/john/FreeAgent Drive" I receive bash: cd: /media/john/FreeAgent Drive: Permission denied However, using sudo: sudo cd /media/john sudo ls -l It gives: drwx------ 1 john john 20480 Sep 24 10:45 FreeAgent Drive/ And id returns uid=1003(john) gid=1003(john) groups=1003(john), ... So I'm interpreting this is as "you are john, only john can access this drive, however, you cannot access this drive." I have tried sudo chown john:john "FreeAgent Drive" and sudo chmod o+rw "john/FreeAgent Drive"but I still can't access it.

    Read the article

1