mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-03 04:18:25 +08:00
docs: Platform tutorial (#2105)
This adds a platformer tutorial called Ember Quest. I hope I have done a service, because I am tired, lol. I am sure there will be comments. I just want to say, I did my best. I approached this as someone new to Flame, just like I was about 10 months ago. Are there concepts that can be improved, sure. We can always optimize code, but I didn't want any concepts to be super abstract. I had never coded a game before when I began my journey with Flame this year, so things might be a bit simple for experienced game developers, but for myself, I had never even thought about a game loop or animations, etc.
This commit is contained in:
19
doc/tutorials/platformer/app/lib/main.dart
Normal file
19
doc/tutorials/platformer/app/lib/main.dart
Normal file
@ -0,0 +1,19 @@
|
||||
import 'package:flame/game.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'ember_quest.dart';
|
||||
import 'overlays/game_over.dart';
|
||||
import 'overlays/main_menu.dart';
|
||||
|
||||
void main() {
|
||||
runApp(
|
||||
GameWidget<EmberQuestGame>.controlled(
|
||||
gameFactory: EmberQuestGame.new,
|
||||
overlayBuilderMap: {
|
||||
'MainMenu': (_, game) => MainMenu(game: game),
|
||||
'GameOver': (_, game) => GameOver(game: game),
|
||||
},
|
||||
initialActiveOverlays: const ['MainMenu'],
|
||||
),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user