@@ -44,10 +44,9 @@ Version:
44
44
updateView : function ( ) {
45
45
if ( ! this . view ) return ;
46
46
47
- this . view . x = this . position . x - this . radius ;
48
- this . view . y = this . position . y - this . radius ;
49
- this . radius = this . lastReceivedEntityDescription . radius ;
50
-
47
+ this . view . x = this . position . x ; // - this.radius;
48
+ this . view . y = this . position . y ; // - this.radius;
49
+ this . view . setScale ( this . lastReceivedEntityDescription . scale * 0.01 , this . lastReceivedEntityDescription . scale * 0.01 ) ;
51
50
return ;
52
51
53
52
var diameter = this . lastReceivedEntityDescription . radius * 2 ;
@@ -62,10 +61,10 @@ Version:
62
61
* @param {Number } gameTick Current game tick (incrimented each frame)
63
62
*/
64
63
updatePosition : function ( speedFactor , gameClock , gameTick ) {
65
- this . handleAcceleration ( ) ;
64
+ this . handleAcceleration ( speedFactor , gameClock , gameTick ) ;
66
65
} ,
67
66
68
- handleAcceleration : function ( ) {
67
+ handleAcceleration : function ( speedFactor , gameClock , gameTick ) {
69
68
this . velocity . translatePoint ( this . acceleration ) ;
70
69
this . velocity . limit ( this . velocityMax ) ;
71
70
this . velocity . multiply ( this . velocityDamping ) ;
@@ -106,12 +105,18 @@ Version:
106
105
107
106
constructEntityDescription : function ( ) {
108
107
var entityDesc = BubbleDots . CircleEntity . superclass . constructEntityDescription . call ( this ) ;
109
- entityDesc += ',' + ~ ~ ( this . radius ) ;
108
+ entityDesc += ',' + ~ ~ ( this . scale * 100 ) ;
110
109
entityDesc += ',' + this . color ;
111
110
112
111
return entityDesc ;
113
112
} ,
114
113
114
+ // addTrait: function( aTrait ) {
115
+ // if( aTrait.displayName === RealtimeMultiplayerGame.controller.traits.KeyboardInputTrait )
116
+ // return BubbleDots.CircleEntity.superclass.addTrait.call(this, aTrait);
117
+ // return null;
118
+ // },
119
+
115
120
///// ACCESSORS
116
121
/**
117
122
* Set the CollisionCircle for this game entity.
@@ -140,7 +145,14 @@ Version:
140
145
this . color = aColor ;
141
146
} ,
142
147
getColor : function ( ) { return this . color } ,
143
- getOriginalColor : function ( ) { return this . originalColor }
148
+ getOriginalColor : function ( ) { return this . originalColor } ,
149
+ setRadius : function ( aRadius ) {
150
+ this . radius = aRadius ;
151
+ this . collisionCircle . setRadius ( this . radius ) ;
152
+ this . scale = this . radius / BubbleDots . Constants . ENTITY_DEFAULT_RADIUS ;
153
+ } ,
154
+ getRadius : function ( ) { return this . radius ; }
155
+
144
156
} ;
145
157
146
158
// extend RealtimeMultiplayerGame.model.GameEntity
0 commit comments