Add new Battler layout

This commit is contained in:
DaInfLoop 2024-04-30 10:57:50 +00:00
parent dd53b46744
commit 7d6fe64cb3
2 changed files with 44 additions and 10 deletions

View file

@ -115,6 +115,18 @@ export enum Opponents {
HouseannorSupport = "HouseannorSupport",
}
export enum Hair {
BeginnerSpikes = "Beginner Spikes",
CasualFro = "Casual Fro",
ProCut = "Pro Cut",
SpecialHair = "Special Hair",
SupportShort = "Support Short",
BuilderTails = "Builder Tails",
}
export enum UpperBottom {}
export enum UpperTop {}
export type GenerateBattlerOptions = {
colour: Colour;
@ -127,6 +139,10 @@ export type GenerateBattlerOptions = {
neck?: ColouredOpt<Necks>;
glow?: Colour | "None";
eye?: ColouredOpt<Eyes>;
hair?: ColouredOpt<Hair>;
upperBottom?: ColouredOpt<UpperBottom>;
upperTop?: ColouredOpt<UpperTop>;
};
export enum PlayerActions {

View file

@ -36,12 +36,36 @@ export async function generateBattler(
const base = await loadImage(`./assets/bases/${opts.colour || "Black"}.png`);
context.drawImage(base, 0, 0, canvas.width, canvas.height);
// [Upper Bottom]
if (opts.upperBottom && opts.upperBottom !== "None") {
const face = await loadImage(`./assets/upperBottom/${opts.face}.png`);
context.drawImage(face, 0, 0, canvas.width, canvas.height);
}
// [Bottom]
if (opts.bottom && opts.bottom !== "None") {
const bottom = await loadImage(`./assets/bottoms/${opts.bottom}.png`);
context.drawImage(bottom, 0, 0, canvas.width, canvas.height);
}
// [Top]
if (opts.top && opts.top !== "None") {
const top = await loadImage(`./assets/tops/${opts.top}.png`);
context.drawImage(top, 0, 0, canvas.width, canvas.height);
}
// [Face]
if (opts.face && opts.face !== "None") {
const face = await loadImage(`./assets/faces/${opts.face}.png`);
context.drawImage(face, 0, 0, canvas.width, canvas.height);
}
// [Hair]
if (opts.hair && opts.hair !== "None") {
const face = await loadImage(`./assets/hair/${opts.hair}.png`);
context.drawImage(face, 0, 0, canvas.width, canvas.height);
}
// [Hat]
if (opts.hat && opts.hat !== "None") {
const hat = await loadImage(`./assets/hats/${opts.hat}.png`);
@ -54,16 +78,10 @@ export async function generateBattler(
context.drawImage(eye, 0, 0, canvas.width, canvas.height);
}
// [Bottom]
if (opts.bottom && opts.bottom !== "None") {
const bottom = await loadImage(`./assets/bottoms/${opts.bottom}.png`);
context.drawImage(bottom, 0, 0, canvas.width, canvas.height);
}
// [Top]
if (opts.top && opts.top !== "None") {
const top = await loadImage(`./assets/tops/${opts.top}.png`);
context.drawImage(top, 0, 0, canvas.width, canvas.height);
// [Upper Top]
if (opts.upperTop && opts.upperTop !== "None") {
const eye = await loadImage(`./assets/upperTop/${opts.upperTop}.png`);
context.drawImage(eye, 0, 0, canvas.width, canvas.height);
}
// [Neck]