2 Created on 21 janv. 2010
13 from numpy
import array
14 from numpy
.linalg
import norm
16 from math
import floor
18 from gui
.constants
import *
19 from PlayingScreen
import PlayingScreen
20 from instruments
.Instrument
import Instrument
21 from cursor
.WarpingCursor
import *
22 from controllers
.Wiimote
import Wiimote
23 from logging
.EventLog
import EventLog
24 from logging
.PickleableEvent
import PickleableEvent
25 from InstrumentChoice
import InstrumentChoice
27 class DummyInstrumentChoice():
33 def __init__(self
,wiimotes
, window
, screen
, clock
, joys
, portOffset
, activeWiimotes
, eventLog
=None, replay
= False, logFilePath
= None, scaleFactor
= 1):
37 self
.wiimotes
=wiimotes
38 self
.activeWiimotes
=activeWiimotes
41 self
.scaleFactor
= scaleFactor
42 self
.width
= int(floor(screen
.get_width()*self
.scaleFactor
))
43 self
.height
= int(floor(screen
.get_height()*self
.scaleFactor
))
44 self
.blitOrigin
= ((self
.screen
.get_width()-self
.width
)/2,(self
.screen
.get_height()-self
.height
)/2)
46 self
.savedScreen
= pygame
.Surface(self
.screen
.get_size())
47 self
.savedScreen
.fill((255, 255, 255))
48 self
.playerScreen
= pygame
.Surface(self
.savedScreen
.get_size())
49 self
.playerScreen
.blit(self
.savedScreen
, (0, 0))
50 self
.cursorPositions
= []
51 for i
in range(len(self
.wiimotes
)):
52 self
.wiimotes
[i
].cursor
.screen
= self
.playerScreen
53 self
.cursorPositions
.append(self
.wiimotes
[i
].cursor
.centerPosition
)
55 self
.portOffset
= portOffset
56 self
.eventLog
= eventLog