Add shareware support and spawn correctly for difficulty levels

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
2026-03-14 17:01:01 +01:00
parent 690ac1e7e6
commit 278c73a256
19 changed files with 383 additions and 238 deletions

View File

@@ -1,8 +1,9 @@
import 'package:flutter/material.dart';
import 'package:wolf_dart/classes/sprite.dart';
import 'package:wolf_dart/features/renderer/color_palette.dart';
class WeaponPainter extends CustomPainter {
final List<List<int>> sprite;
final Sprite? sprite;
// Initialize a reusable Paint object and disable anti-aliasing to keep the
// pixels perfectly sharp and chunky.
@@ -14,6 +15,8 @@ class WeaponPainter extends CustomPainter {
@override
void paint(Canvas canvas, Size size) {
if (sprite == null) return;
// Calculate width and height separately in case the container isn't a
// perfect square
double pixelWidth = size.width / 64;
@@ -21,7 +24,7 @@ class WeaponPainter extends CustomPainter {
for (int x = 0; x < 64; x++) {
for (int y = 0; y < 64; y++) {
int colorByte = sprite[x][y];
int colorByte = sprite![x][y];
if (colorByte != 255) {
// 255 is our transparent magenta