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
import 'dart:ui'; | |
import 'package:mazeball/Views/base/baseView.dart'; | |
import 'package:mazeball/Views/mainMenuBackground.dart'; | |
import 'package:mazeball/Views/optionBackground.dart'; | |
import 'package:mazeball/Views/playingView.dart'; | |
import 'package:mazeball/game.dart'; | |
import 'base/viewSwtichMessage.dart'; | |
class ViewManager { | |
List<BaseView> views; |
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
import 'package:flutter/widgets.dart'; | |
import 'package:mazeball/Views/base/viewSwtichMessage.dart'; | |
import 'package:mazeball/Views/viewManager.dart'; | |
enum GameView { | |
MainMenuBackground, | |
Playing, | |
Win, | |
Options, | |
} |
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
import 'dart:ui'; | |
import 'package:box2d_flame/box2d.dart' as box2d; | |
import 'package:mazeball/Elements/wall.dart'; | |
import 'package:mazeball/game.dart'; | |
import 'package:theseus/theseus.dart'; | |
class MazeBuilder { | |
//Size of the maze | |
int _width; | |
int _height; |
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
import 'dart:ui'; | |
import 'package:box2d_flame/box2d.dart'; | |
import 'package:mazeball/game.dart'; | |
import 'package:mazeball/helper.dart'; | |
class Wall { | |
//Ref to our game object | |
final MazeBallGame game; | |
//Size of the ball, radius in meter | |
static final double wallWidth = 5; |
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
mode: ASCIIMode.lines | |
_________________ | |
_____ | _ | | |
|_ | _|___| _| | |
| _|___ |_ | | |
| | ___|_ | | | |
| | | | _ |_| | | |
| |_| | | | | _| | |
| | | | | | | | | |
|_|_|_____|______ |
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
import 'package:theseus/theseus.dart'; | |
import 'package:theseus/src/formatters/formatters.dart' as formatters; | |
main(List<String> arguments) { | |
var mazeOption = MazeOptions(width: 8, height: 8); | |
var orthogonalMaze = OrthogonalMaze(mazeOption); | |
print("generating the maze..."); | |
orthogonalMaze.generate(); | |
printMaze(orthogonalMaze); |
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
import 'dart:ui'; | |
import 'package:box2d_flame/box2d.dart'; | |
import 'package:mazeball/game.dart'; | |
import 'package:sensors/sensors.dart'; | |
class Ball { | |
final MazeBallGame game; | |
//Physic objects | |
Body body; | |
CircleShape shape; |
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
import 'dart:ui'; | |
import 'package:box2d_flame/box2d.dart'; | |
import 'package:flame/flame.dart'; | |
import 'package:flame/game.dart'; | |
class MazeBallGame extends Game { | |
//Needed for Box2D | |
static const int WORLD_POOL_SIZE = 100; | |
static const int WORLD_POOL_CONTAINER_SIZE = 10; | |
//Main physic object -> our game world |