Files
Munsterlander 2a3b8998bf docs: Space Shooter Tutorial Migrated (#2135)
As discussed previously, this PR moves the Space Shooter Tutorial to the tutorials folder for direct inclusion in the docs. A few things to note, other than basic grammar and formatting, nothing was changed other than migrating the information to the current tutorial format. This should allow the tutorials.flame-engine.org subdomain to be deleted.

Note: Upon moving this tutorial, I discovered it is incomplete and missing the majority of the game.

Also, I realized that I left the android folder and some files that weren't necessary for the platform tutorial and have deleted those.
2022-11-04 13:26:24 +01:00

29 lines
602 B
Dart

import 'package:flame/components.dart';
import 'package:flame/game.dart';
import 'package:flutter/material.dart';
void main() {
runApp(GameWidget(game: SpaceShooterGame()));
}
class Player extends PositionComponent {
static final _paint = Paint()..color = Colors.white;
@override
void render(Canvas canvas) {
canvas.drawRect(size.toRect(), _paint);
}
}
class SpaceShooterGame extends FlameGame {
@override
Future<void> onLoad() async {
add(
Player()
..position = size / 2
..width = 50
..height = 100
..anchor = Anchor.center,
);
}
}