Ignore:
Timestamp:
09/06/13 09:39:48 (9 years ago)
Author:
Jeremy Thurgood <firxen@…>
Branch:
default
Phase:
public
Message:

Physics-related cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/utils.py

    r29 r334  
    11import pygame
     2from pymunk.vec2d import Vec2d
    23
    34
     
    1011        return pygame.Color(colour)
    1112    raise ValueError()
     13
     14
     15def vec_from_angle(angle, length=1):
     16    vec = Vec2d(length, 0)
     17    vec.angle = angle
     18    return vec
     19
     20
     21def vec_with_length(coords, length=1):
     22    vec = Vec2d(coords)
     23    vec.length = length
     24    return vec
Note: See TracChangeset for help on using the changeset viewer.