Add shareware support and spawn correctly for difficulty levels
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user