mirror of
				https://github.com/flame-engine/flame.git
				synced 2025-11-04 04:47:13 +08:00 
			
		
		
		
	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.
		
			
				
	
	
		
			20 lines
		
	
	
		
			486 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			486 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
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'],
 | 
						|
    ),
 | 
						|
  );
 | 
						|
}
 |