This repository has been archived by the owner on Apr 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from warioddly/master
Add map generator
- Loading branch information
Showing
9 changed files
with
133 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import 'dart:ui'; | ||
|
||
import 'package:flame/collisions.dart'; | ||
import 'package:flame/components.dart'; | ||
import 'package:pacman/config/constants.dart'; | ||
import 'package:pacman/game.dart'; | ||
|
||
|
||
|
||
class Wall extends PositionComponent with HasGameRef<PacmanGame>, CollisionCallbacks { | ||
|
||
|
||
final paint = Paint() | ||
..color = const Color(0xFF0000FF) | ||
..strokeWidth = 2.0 | ||
..style = PaintingStyle.stroke; | ||
|
||
|
||
@override | ||
Future<void> onLoad() async { | ||
await super.onLoad(); | ||
|
||
add( | ||
RectangleComponent( | ||
size: Vector2.all(tileSize), | ||
paint: paint, | ||
), | ||
); | ||
|
||
add(RectangleHitbox(size: Vector2.all(tileSize))); | ||
|
||
} | ||
|
||
|
||
|
||
// @override | ||
// void onCollisionStart(Set<Vector2> intersectionPoints, PositionComponent other) { | ||
// super.onCollisionStart(intersectionPoints, other); | ||
// | ||
// | ||
// } | ||
|
||
|
||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
|
||
const double tileSize = 30.0; | ||
|
||
const double playerSpeed = 100.0; | ||
|
||
const double enemySpeed = 100.0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters