@@ -37,40 +37,36 @@ class Reg
3737 * Draws the bounce panels. Useful for mobile devices with weird resolutions.
3838 *
3939 * @param Height The height of the panel to draw.
40- * @return A BitmapData object representing the paddle. Cached for the second paddle to save time.
40+ * @return A BitmapData object representing the paddle.
4141 */
42- static public function getBounceImage (Height : Int ): BitmapData
42+ static public function createBounceImage (Height : Int ): BitmapData
4343 {
44- if ( _bitmapData != null )
45- return _bitmapData ;
44+ var bitmapData : BitmapData = new BitmapData ( 8 , Height , false , GREY_MED );
45+ var rect : Rectangle ;
4646
47- _bitmapData = new BitmapData (8 , Height , false , GREY_MED );
47+ rect = new Rectangle (4 , 0 , 4 , Height );
48+ bitmapData .fillRect (rect , GREY_LIGHT );
49+ rect = new Rectangle (0 , 1 , 1 , Height - 2 );
50+ bitmapData .fillRect (rect , GREY_DARK );
51+ rect .x = 3 ;
52+ bitmapData .fillRect (rect , GREY_DARK );
53+ rect = new Rectangle (1 , 0 , 2 , 1 );
54+ bitmapData .fillRect (rect , GREY_DARK );
55+ rect .y = Height - 1 ;
56+ bitmapData .fillRect (rect , GREY_DARK );
57+ rect = new Rectangle (4 , 1 , 1 , Height - 2 );
58+ bitmapData .fillRect (rect , WHITE );
59+ rect .x = 7 ;
60+ bitmapData .fillRect (rect , WHITE );
61+ rect = new Rectangle (5 , 0 , 2 , 1 );
62+ bitmapData .fillRect (rect , WHITE );
63+ rect .y = Height - 1 ;
64+ bitmapData .fillRect (rect , WHITE );
4865
49- _rect = new Rectangle (4 , 0 , 4 , Height );
50- _bitmapData .fillRect (_rect , GREY_LIGHT );
51- _rect = new Rectangle (0 , 1 , 1 , Height - 2 );
52- _bitmapData .fillRect (_rect , GREY_DARK );
53- _rect .x = 3 ;
54- _bitmapData .fillRect (_rect , GREY_DARK );
55- _rect = new Rectangle (1 , 0 , 2 , 1 );
56- _bitmapData .fillRect (_rect , GREY_DARK );
57- _rect .y = Height - 1 ;
58- _bitmapData .fillRect (_rect , GREY_DARK );
59- _rect = new Rectangle (4 , 1 , 1 , Height - 2 );
60- _bitmapData .fillRect (_rect , WHITE );
61- _rect .x = 7 ;
62- _bitmapData .fillRect (_rect , WHITE );
63- _rect = new Rectangle (5 , 0 , 2 , 1 );
64- _bitmapData .fillRect (_rect , WHITE );
65- _rect .y = Height - 1 ;
66- _bitmapData .fillRect (_rect , WHITE );
67-
68- return _bitmapData ;
66+ return bitmapData ;
6967 }
7068
7169 // This is all stuff used for drawing the paddles.
72- static var _bitmapData : BitmapData ;
73- static var _rect : Rectangle ;
7470
7571 inline static var WHITE : Int = 0xffFFFFFF ;
7672 inline static var GREY_LIGHT : Int = 0xffB0B0BF ;
0 commit comments