Skip to content

Commit

Permalink
memes the universe and everything
Browse files Browse the repository at this point in the history
  • Loading branch information
NightLightLumie committed Apr 25, 2024
1 parent 2fd18ee commit 42660f8
Show file tree
Hide file tree
Showing 97 changed files with 4,173 additions and 9 deletions.
74 changes: 73 additions & 1 deletion src/assets/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,46 @@ import { image, sound, music, loadFont, spritesheet } from './util';
const images: Image[] = [
// Backgrounds
image('backgrounds/background', 'background'),
image('backgrounds/bkg_test', 'bkg_test'),
image('backgrounds/upgrade_page', 'upgrade_page'),
image('backgrounds/widgets_0', 'widgets_0'),
image('backgrounds/widgets_1', 'widgets_1'),
image('backgrounds/widgets_2', 'widgets_2'),
image('backgrounds/widgets_3', 'widgets_3'),
image('backgrounds/widgets_4', 'widgets_4'),
image('backgrounds/1-0', '1-0'),
image('backgrounds/1-1', '1-1'),
image('backgrounds/1-2', '1-2'),
image('backgrounds/1-3', '1-3'),
image('backgrounds/blank_bkg', 'blank_bkg'),


// Characters
image('characters/player', 'player'),
image('characters/enemy_1', 'enemy_1'),
image('characters/enemy_2', 'enemy_2'),
image('characters/enemy_3', 'enemy_3'),
image('characters/enemy_4', 'enemy_4'),
image('characters/bullet_1', 'bullet_1'),
image('characters/missile', 'missile'),
image('characters/blank', 'blank'),
image('characters/flak', 'flak'),
image('characters/purple_bullet', 'purple_bullet'),
image('characters/small_bullet', 'small_bullet'),
image('characters/green_bullet', 'green_bullet'),

// Items
image('items/coin', 'coin'),
image('items/red', 'red'),
image('items/blue', 'blue'),
image('items/gold', 'gold'),
image('items/rainbow', 'rainbow'),
image('items/gray', 'gray'),
image('items/next_scene_button', 'next_scene_button'),

// UI
image('ui/hud', 'hud'),
image('ui/lives_bar', 'lives_bar'),

// Titlescreen
image('titlescreen/sky', 'title_sky'),
Expand All @@ -24,18 +55,59 @@ const images: Image[] = [

/* Spritesheets */
const spritesheets: SpriteSheet[] = [
spritesheet("sprites/turretbase", "turretbase", 256, 256),
spritesheet("sprites/gun_1", "gun_1", 256, 256),
spritesheet("sprites/enemy_5", "enemy_5", 256, 256),
spritesheet("sprites/next_button", "next_button", 256, 256),
//spritesheet("sprites/bullet_1", "bullet_1", 128, 128),
spritesheet("effects/flash", "flash", 128, 128),
spritesheet("effects/hit_spark", "hit_spark", 128, 128),
spritesheet("effects/meme_explosion", "meme_explosion", 200, 282),
spritesheet("effects/explosion_orange", "explosion_orange", 256, 256),
spritesheet("effects/explosion_tiny", "explosion_tiny", 512, 512),
spritesheet("effects/bad_fire", "bad_fire", 512, 512),
spritesheet("effects/blue_sparkle", "blue_sparkle", 256, 256),
spritesheet("effects/gray_magic", "gray_magic", 128, 128),
spritesheet("effects/red_magic", "red_magic", 128, 128),
spritesheet("effects/blue_magic", "blue_magic", 128, 128),
spritesheet("effects/gold_magic", "gold_magic", 128, 128),
spritesheet("effects/rainbow_magic", "rainbow_magic", 128, 128),

];

/* Audios */
const audios: Audio[] = [
music('title', 'm_main_menu'),
music('first', 'm_first'),
music('st1', 'm_st1'),
music('st2', 'm_st2'),
sound('tree/rustle', 't_rustle', 0.5),
sound('tree/siren', 'siren', 0.8),
sound('tree/shot_1', 'shot_1', 0.25),
sound('tree/hit_1', 'hit_1', 0.25),
sound('tree/turret_dead', 'turret_dead', 0.25),
sound('tree/dead_1', 'dead_1', 0.25),
sound('tree/dead_2', 'dead_2', 0.25),
sound('tree/dead_3', 'dead_3', 0.25),
sound('tree/dead_4', 'dead_4', 0.25),
sound('tree/dead_5', 'dead_5', 0.25),
sound('tree/hit_pierce', 'hit_pierce', 0.25),
sound('tree/spawn', 'spawn', 0.25),
sound('tree/machinegun', 'machinegun', 0.25),
sound('tree/missile_sound', 'missile_sound', 0.25),
sound('tree/meme_explosion_sound', 'meme_explosion_sound', 0.25),
sound('tree/crit', 'crit', 0.25),
sound('tree/bigfire', 'bigfire', 0.25),
sound('tree/onhit', 'onhit', 0.25),
sound('tree/scroll', 'scroll', 0.25),
sound('tree/place', 'place', 0.25),
sound('tree/turret_hit', 'turret_hit', 0.25),
sound('tree/escape', 'escape', 0.25),
sound('tree/big_gun_1', 'big_gun_1', 0.25),
];

/* Fonts */
await loadFont('Sketch', 'Game Font');
await loadFont('DynaPuff-Medium', 'Game Font');

export {
images,
Expand Down
Binary file added src/assets/images/backgrounds/1-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/backgrounds/1-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/backgrounds/1-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/backgrounds/1-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/backgrounds/bkg_test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/backgrounds/blank_bkg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/backgrounds/upgrade_page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/backgrounds/widgets_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/backgrounds/widgets_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/backgrounds/widgets_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/backgrounds/widgets_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/backgrounds/widgets_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/characters/blank.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/characters/bullet_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/characters/enemy_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/characters/enemy_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/characters/enemy_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/characters/enemy_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/characters/flak.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/characters/green_bullet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/characters/missile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/characters/purple_bullet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/characters/small_bullet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/effects/bad_fire.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/effects/blue_magic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/effects/blue_sparkle.png
Binary file added src/assets/images/effects/explosion_orange.png
Binary file added src/assets/images/effects/explosion_tiny.png
Binary file added src/assets/images/effects/flash.png
Binary file added src/assets/images/effects/gold_magic.png
Binary file added src/assets/images/effects/gray_magic.png
Binary file added src/assets/images/effects/hit_spark.png
Binary file added src/assets/images/effects/meme_explosion.png
Binary file added src/assets/images/effects/rainbow_magic.png
Binary file added src/assets/images/effects/red_magic.png
Binary file added src/assets/images/items/blue.png
Binary file added src/assets/images/items/gold.png
Binary file added src/assets/images/items/gray.png
Binary file added src/assets/images/items/next_scene_button.png
Binary file added src/assets/images/items/rainbow.png
Binary file added src/assets/images/items/red.png
Binary file added src/assets/images/sprites/bullet_1.png
Binary file added src/assets/images/sprites/enemy_5.png
Binary file added src/assets/images/sprites/gun_1.png
Binary file added src/assets/images/sprites/next_button.png
Binary file added src/assets/images/sprites/turretbase.png
Binary file added src/assets/images/ui/lives_bar.png
Binary file added src/assets/music/st1.mp3
Binary file not shown.
Binary file added src/assets/music/st2.mp3
Binary file not shown.
Binary file added src/assets/sounds/tree/big_gun_1.mp3
Binary file not shown.
Binary file added src/assets/sounds/tree/bigfire.mp3
Binary file not shown.
Binary file added src/assets/sounds/tree/crit.mp3
Binary file not shown.
Binary file added src/assets/sounds/tree/dead_1.mp3
Binary file not shown.
Binary file added src/assets/sounds/tree/dead_2.mp3
Binary file not shown.
Binary file added src/assets/sounds/tree/dead_3.mp3
Binary file not shown.
Binary file added src/assets/sounds/tree/dead_4.mp3
Binary file not shown.
Binary file added src/assets/sounds/tree/dead_5.mp3
Binary file not shown.
Binary file added src/assets/sounds/tree/escape.mp3
Binary file not shown.
Binary file added src/assets/sounds/tree/hit_1.mp3
Binary file not shown.
Binary file added src/assets/sounds/tree/hit_pierce.mp3
Binary file not shown.
Binary file added src/assets/sounds/tree/machinegun.mp3
Binary file not shown.
Binary file not shown.
Binary file added src/assets/sounds/tree/missile_sound.mp3
Binary file not shown.
Binary file added src/assets/sounds/tree/onhit.mp3
Binary file not shown.
Binary file added src/assets/sounds/tree/place.mp3
Binary file not shown.
Binary file added src/assets/sounds/tree/scroll.mp3
Binary file not shown.
Binary file added src/assets/sounds/tree/shot_1.mp3
Binary file not shown.
Binary file added src/assets/sounds/tree/siren.mp3
Binary file not shown.
Binary file added src/assets/sounds/tree/spawn.mp3
Binary file not shown.
Binary file added src/assets/sounds/tree/turret_dead.mp3
Binary file not shown.
Binary file added src/assets/sounds/tree/turret_hit.mp3
Binary file not shown.
74 changes: 74 additions & 0 deletions src/components/BasicEffect.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import { GameScene } from "@/scenes/GameScene";

export class BasicEffect extends Phaser.GameObjects.Container {
public scene: GameScene;
public sp: Phaser.GameObjects.Sprite;
private isLooped: boolean;
private frameLength: number;
private timer: number = 0;
private totalFrames: number;
private startingFrame: number;
private currentFrame: number = 0;
public deleteFlag: boolean = false;
public velocityX: number = 0;
public velocityY: number = 0;
public spAngle: number;

// private hover: boolean;
constructor(scene: GameScene, value: string, x: number, y: number, tFrames: number, fLen: number = 100, loop: boolean = false, sFrame: number = 0, angle: number = 0, scale: number = 1) {
super(scene,x,y);
this.scene = scene;
scene.add.existing(this);
this.sp = this.scene.add.sprite(x, y, value);
this.sp.setOrigin(0.5, 0.5);
this.sp.setAngle((180/Math.PI)*angle);
this.sp.setScale(scale, scale);
this.frameLength = fLen;
this.isLooped = loop;
this.totalFrames = tFrames;
this.startingFrame = sFrame;
this.currentFrame = this.startingFrame;
this.sp.setFrame(this.startingFrame);
// scene.add.existing(this.sp);
}

setVelocityX(v: number){
this.velocityX = v;
}

setVelocityY(v: number) {
this.velocityY = v;
}

stopMovement(){
this.velocityX = 0;
this.velocityY = 0;
}

update(d: number){
if(this.deleteFlag){
return;
}
if (this.timer <= this.frameLength) {
this.timer += d;
this.x += this.velocityX*d*0.001;
this.y += this.velocityY*d*0.001;
if (this.timer >= this.frameLength) {
this.timer = 0;
if(this.currentFrame < (this.totalFrames-1)) {
this.currentFrame++;
this.sp.setFrame(this.currentFrame);
} else if (this.currentFrame >= (this.totalFrames-1)) {
if(this.isLooped) {
this.currentFrame = 0;
this.sp.setFrame(this.currentFrame);
} else {
this.deleteFlag = true;
this.sp.setAlpha(0);
}
}

}
}
}
}
Loading

0 comments on commit 42660f8

Please sign in to comment.