Facebook
From noemi, 6 Years ago, written in Plain Text.
This paste is a reply to my testament from noemi - view diff
Embed
Download Paste or View Raw
Hits: 348
  1. 6 th list - introduction to programming
  2.  
  3. Many games have implemented complex physical engines. One of their functions is to detect collisions between onscreen objects.
  4. Let's say those objects are discs on 2 dimentional plane.
  5.  
  6. 1. Create a representation of a disc using one of inbuilt Python data types.
  7.  
  8. 2. Write a function that will detect collision between 2 discs. Return True if it happens.
  9.  
  10. 3. Write a function that can move disc of a given vector.
  11.  
  12. 4. Make a module ot of 2&3, create documentation.
  13.  
  14. 5. Write a program that on a plane -15 <= x,y <= 15 (30 x 30):
  15.    a. will randomly spread 100 discs, radius 0.5
  16.    b. detect collisions between them
  17.    c. move them by vectors so they dont collide, but still are in given area
  18.    
  19.    Program should end after there are no more collisions.
  20.    First configuration and the succesful one should be printed in console.
  21.    And it should be all shown on graph.
  22.    
  23.    
  24.    
  25.  
  26.