@@ -13,6 +13,7 @@ import 'package:wolf_dart/features/entities/entity_registry.dart';
|
||||
import 'package:wolf_dart/features/map/wolf_map.dart';
|
||||
import 'package:wolf_dart/features/player/player.dart';
|
||||
import 'package:wolf_dart/features/renderer/raycast_painter.dart';
|
||||
import 'package:wolf_dart/features/ui/hud.dart';
|
||||
import 'package:wolf_dart/sprite_gallery.dart';
|
||||
|
||||
class WolfRenderer extends StatefulWidget {
|
||||
@@ -329,33 +330,42 @@ class _WolfRendererState extends State<WolfRenderer>
|
||||
focusNode: _focusNode,
|
||||
autofocus: true,
|
||||
onKeyEvent: (_) {},
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
return Stack(
|
||||
children: [
|
||||
CustomPaint(
|
||||
size: Size(constraints.maxWidth, constraints.maxHeight),
|
||||
painter: RaycasterPainter(
|
||||
map: currentLevel,
|
||||
textures: gameMap.textures,
|
||||
player: player,
|
||||
fov: fov,
|
||||
doorOffsets: doorOffsets,
|
||||
entities: entities,
|
||||
sprites: gameMap.sprites,
|
||||
),
|
||||
),
|
||||
if (damageFlashOpacity > 0)
|
||||
Positioned.fill(
|
||||
child: Container(
|
||||
color: Colors.red.withValues(
|
||||
alpha: damageFlashOpacity,
|
||||
child: Column(
|
||||
children: [
|
||||
// Game view
|
||||
Expanded(
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
return Stack(
|
||||
children: [
|
||||
CustomPaint(
|
||||
size: Size(constraints.maxWidth, constraints.maxHeight),
|
||||
painter: RaycasterPainter(
|
||||
map: currentLevel,
|
||||
textures: gameMap.textures,
|
||||
player: player,
|
||||
fov: fov,
|
||||
doorOffsets: doorOffsets,
|
||||
entities: entities,
|
||||
sprites: gameMap.sprites,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
if (damageFlashOpacity > 0)
|
||||
Positioned.fill(
|
||||
child: Container(
|
||||
color: Colors.red.withValues(
|
||||
alpha: damageFlashOpacity,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
// HUD
|
||||
Hud(player: player),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user