Skip to content

Commit 19c5eda

Browse files
committed
it is better
1 parent 7760cf9 commit 19c5eda

File tree

2 files changed

+3
-73
lines changed

2 files changed

+3
-73
lines changed

src/Block.as

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,7 @@ package
4444
{
4545
counter = 0;
4646
move(0,1)
47+
}
48+
}
4749
}
4850
}

src/Player.as

Lines changed: 1 addition & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ package
3838
{
3939
if (!blocks.members[i].canMove(dx,dy))
4040
{
41+
trace("this block shouldn't move");
4142
trace(blocks.members[i].x, blocks.members[i].y);
4243
moveBlocks = false;
4344
}
@@ -64,14 +65,10 @@ package
6465

6566
override public function update():void
6667
{
67-
// trace(blocks.members.length);
6868
counter += FlxG.elapsed;
6969
if (counter >= 0.11)
7070
{
7171
counter = 0;
72-
// var block:Block;
73-
// var i:String;
74-
// var moveBlocks:Boolean = true;
7572
if (FlxG.keys.LEFT)
7673
{
7774
move(-1,0);
@@ -88,75 +85,6 @@ package
8885
facing = RIGHT;
8986
}
9087
}
91-
92-
// if (FlxG.keys.LEFT && x - frameWidth >= 0)
93-
// {
94-
// if (blocks.members.length > 0)
95-
// {
96-
//// move(-1,0)
97-
// x -= frameWidth;
98-
// for (i in blocks.members)
99-
// {
100-
// block = blocks.members[i];
101-
//// block.move(-1,0);
102-
// if (block.overlapsAt(block.x - frameWidth,block.y,allBlocks))// &&!overlapsAt(x - frameWidth, y, allBlocks))
103-
// {
104-
// moveBlocks = false;
105-
//// block.x -= frameWidth;
106-
//// x -= frameWidth;
107-
// }
108-
// }
109-
// if (moveBlocks)
110-
// {
111-
// for (i in blocks.members)
112-
// {
113-
// block = blocks.members[i];
114-
// trace(block.x,block.y);
115-
// block.x -= frameWidth;
116-
// }
117-
// }
118-
// }
119-
// else if (blocks.members.length <=0)
120-
// {
121-
// x -= frameWidth;
122-
//// move(-1,0)
123-
// facing = LEFT;
124-
// }
125-
// }
126-
// if (FlxG.keys.RIGHT && x + frameWidth <= FlxG.width - frameWidth)
127-
// {
128-
// if (blocks.members.length > 0)
129-
// {
130-
//// move(1,0);
131-
// x += frameWidth;
132-
// for (i in blocks.members)
133-
// {
134-
// block = blocks.members[i];
135-
//// block.move(1,0);
136-
// if (block.overlapsAt(block.x + frameWidth,block.y,allBlocks))// && !overlapsAt(x + frameWidth, y, allBlocks))
137-
// {
138-
// moveBlocks = false;
139-
//// block.x += frameWidth;
140-
//// x += frameWidth;
141-
// }
142-
// }
143-
// if (moveBlocks)
144-
// {
145-
// for (i in blocks.members)
146-
// {
147-
// block = blocks.members[i];
148-
// block.x += frameWidth;
149-
// }
150-
// }
151-
// }
152-
// else if (blocks.members.length <= 0)
153-
// {
154-
//// move(1,0);
155-
// facing = RIGHT;
156-
// x += frameWidth;
157-
// }
158-
//
159-
// }
16088
}
16189

16290
if (isTouching(FLOOR))

0 commit comments

Comments
 (0)