Skip to content

Commit

Permalink
Merge pull request #6 from warioddly/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
warioddly authored Nov 25, 2023
2 parents 2a900f3 + c38a902 commit 31dfecd
Show file tree
Hide file tree
Showing 65 changed files with 881 additions and 166 deletions.
Binary file added assets/images/decorations/brands/github.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 assets/images/decorations/brands/hackerrank.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 assets/images/decorations/brands/instagram.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 assets/images/decorations/brands/io.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 assets/images/decorations/brands/leetcode.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 assets/images/decorations/brands/linkedin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
12 changes: 6 additions & 6 deletions lib/game.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:bonfire/bonfire.dart';
import 'package:warioddly/shared/worlds/blackhole.dart';
import 'package:warioddly/shared/worlds/dungeon.dart';
import 'package:warioddly/game_manual_controller.dart';
import 'package:warioddly/shared/player/wizard_interface.dart';
import 'package:warioddly/shared/player/wizard.dart';
Expand Down Expand Up @@ -35,18 +35,18 @@ class GameManualMap extends StatelessWidget {
],
),
debugMode: false,
player: Wizard(Vector2((4 * BlackHole.tileSize), (6 * BlackHole.tileSize))),
player: Wizard(Vector2((4 * Dungeon.tileSize), (6 * Dungeon.tileSize))),
interface: KnightInterface(),
components: [
...BlackHole.enemies(),
...BlackHole.decorations(),
...Dungeon.enemies(),
...Dungeon.decorations(),
GameManualController(),
],
cameraConfig: CameraConfig(
zoom: getZoomFromMaxVisibleTile(context, BlackHole.tileSize, 20),
zoom: getZoomFromMaxVisibleTile(context, Dungeon.tileSize, 20),
speed: 1.5,
),
map: BlackHole.map(),
map: Dungeon.map(),
backgroundColor: Colors.blueGrey[900]!,
lightingColorGame: Colors.black.withOpacity(0.75),
);
Expand Down
8 changes: 4 additions & 4 deletions lib/game_manual_controller.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'dart:math';
import 'package:bonfire/bonfire.dart';
import 'package:warioddly/shared/worlds/blackhole.dart';
import 'package:warioddly/shared/worlds/dungeon.dart';
import 'package:warioddly/shared/npc/goblin.dart';
import 'shared/others/sprite_sheets/common_sprite_sheet.dart';

Expand All @@ -17,15 +17,15 @@ class GameManualController extends GameComponent {
}

void _addEnemyInWorld() {
double x = BlackHole.tileSize * (4 + Random().nextInt(25));
double y = BlackHole.tileSize * (5 + Random().nextInt(3));
double x = Dungeon.tileSize * (4 + Random().nextInt(25));
double y = Dungeon.tileSize * (5 + Random().nextInt(3));

final goblin = Goblin(Vector2(x, y));

gameRef.add(
AnimatedGameObject(
animation: CommonSpriteSheet.smokeExplosion,
size: Vector2.all(BlackHole.tileSize),
size: Vector2.all(Dungeon.tileSize),
position: goblin.position,
loop: false,
),
Expand Down
4 changes: 2 additions & 2 deletions lib/shared/decorations/barrel_dragable.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:bonfire/bonfire.dart';
import 'package:warioddly/shared/others/sprite_sheets/common_sprite_sheet.dart';
import 'package:warioddly/shared/worlds/blackhole.dart';
import 'package:warioddly/shared/worlds/dungeon.dart';
import 'package:flutter/material.dart';

class BarrelDraggable extends GameDecoration
Expand All @@ -14,7 +14,7 @@ class BarrelDraggable extends GameDecoration
: super.withSprite(
sprite: CommonSpriteSheet.barrelSprite,
position: position,
size: Vector2.all(BlackHole.tileSize),
size: Vector2.all(Dungeon.tileSize),
) {
_textConfig = TextPaint(
style: TextStyle(color: Colors.white, fontSize: width / 4),
Expand Down
8 changes: 4 additions & 4 deletions lib/shared/decorations/chest.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:bonfire/bonfire.dart';
import 'package:warioddly/shared/decorations/potion_life.dart';
import 'package:warioddly/shared/others/sprite_sheets/common_sprite_sheet.dart';
import 'package:warioddly/shared/worlds/blackhole.dart';
import 'package:warioddly/shared/worlds/dungeon.dart';
import 'package:flutter/material.dart';

class Chest extends GameDecoration with TapGesture, Vision {
Expand All @@ -11,7 +11,7 @@ class Chest extends GameDecoration with TapGesture, Vision {
Chest(Vector2 position)
: super.withAnimation(
animation: CommonSpriteSheet.chestAnimated,
size: Vector2.all(BlackHole.tileSize * 0.6),
size: Vector2.all(Dungeon.tileSize * 0.6),
position: position,
) {
_textConfig = TextPaint(
Expand All @@ -36,7 +36,7 @@ class Chest extends GameDecoration with TapGesture, Vision {
notObserved: () {
_observedPlayer = false;
},
radiusVision: BlackHole.tileSize,
radiusVision: Dungeon.tileSize,
);
}
super.update(dt);
Expand Down Expand Up @@ -91,7 +91,7 @@ class Chest extends GameDecoration with TapGesture, Vision {
AnimatedGameObject(
animation: CommonSpriteSheet.smokeExplosion,
position: position,
size: Vector2.all(BlackHole.tileSize * 0.5),
size: Vector2.all(Dungeon.tileSize * 0.5),
loop: false,
),
);
Expand Down
12 changes: 6 additions & 6 deletions lib/shared/decorations/column.dart
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import 'package:bonfire/bonfire.dart';
import 'package:warioddly/shared/worlds/blackhole.dart';
import 'package:warioddly/shared/worlds/dungeon.dart';
import 'package:warioddly/shared/others/sprite_sheets/common_sprite_sheet.dart';

class ColumnDecoration extends GameDecoration {
ColumnDecoration(Vector2 position)
: super.withSprite(
sprite: CommonSpriteSheet.columnSprite,
position: position,
size: Vector2(BlackHole.tileSize, BlackHole.tileSize * 3),
size: Vector2(Dungeon.tileSize, Dungeon.tileSize * 3),
);

@override
Future<void> onLoad() {
add(
RectangleHitbox(
size: Vector2(
BlackHole.tileSize * 0.8,
BlackHole.tileSize / 2,
Dungeon.tileSize * 0.8,
Dungeon.tileSize / 2,
),
position: Vector2(
BlackHole.tileSize * 0.1,
BlackHole.tileSize * 1.8,
Dungeon.tileSize * 0.1,
Dungeon.tileSize * 1.8,
),
),
);
Expand Down
19 changes: 19 additions & 0 deletions lib/shared/decorations/crystal/blue_crystal.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import 'package:bonfire/bonfire.dart';
import 'package:warioddly/shared/decorations/crystal/crystal.dart';
import 'package:warioddly/shared/others/models/portfolio_model.dart';
import 'package:warioddly/shared/others/sprite_sheets/crystal_sprite_sheet.dart';
import 'package:flutter/material.dart';

class BlueCrystal extends Crystal {

BlueCrystal({
required Vector2 position,
ProjectModel? project,
}) : super(
project: project,
position: position,
sprite: CrystalSpriteSheet.blue,
color: Colors.blueAccent.withOpacity(0.4),
);

}
105 changes: 105 additions & 0 deletions lib/shared/decorations/crystal/crystal.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
import 'package:bonfire/bonfire.dart';
import 'package:warioddly/shared/others/actions/decoration_dialog.dart';
import 'package:warioddly/shared/others/models/portfolio_model.dart';
import 'package:warioddly/shared/others/sprite_sheets/crystal_sprite_sheet.dart';
import 'package:warioddly/shared/others/sprite_sheets/common_sprite_sheet.dart';
import 'package:flutter/material.dart';

class Crystal extends GameDecoration with TapGesture, Vision {

Crystal({
required Vector2 position,
required Future<Sprite> sprite,
Vector2? size,
Color? color,
this.project,
}) : super.withSprite(
sprite: sprite,
size: size ?? CrystalSpriteSheet.size,
position: position,
lightingConfig: LightingConfig(
radius: CrystalSpriteSheet.size.x,
blurBorder: CrystalSpriteSheet.size.x,
color: color ?? Colors.white.withOpacity(0.4),
withPulse: true,
)
);


ProjectModel? project;
bool _observedPlayer = false;
late final TextPaint _textConfig = TextPaint(
style: TextStyle(
color: const Color(0xFFFFFFFF),
fontFamily: 'VT323',
fontSize: width / 2,
),
);


@override
Future<void> onLoad() {
add(RectangleHitbox());
return super.onLoad();
}


@override
void update(double dt) {
if (gameRef.player != null && checkInterval('SeepLayr', 500, dt)) {
seeComponent(
gameRef.player!,
observed: (player) {
if (!_observedPlayer) {
_observedPlayer = true;
_showEmote();
}
},
notObserved: () {
_observedPlayer = false;
},
radiusVision: CrystalSpriteSheet.size.x,
);
}
super.update(dt);
}


@override
void render(Canvas canvas) {
super.render(canvas);
if (_observedPlayer) {
_textConfig.render(
canvas,
'Touch me',
Vector2(width / -4.5, height),
);
}
}


@override
void onTap() {
if (_observedPlayer && project != null) {
CrystalDialog.show(gameRef, this, project!);
}
}


@override
void onTapCancel() {}


void _showEmote() {
add(
AnimatedGameObject(
animation: CommonSpriteSheet.emote,
size: size,
position: Vector2(width / -12, -height),
loop: false,
),
);
}


}
20 changes: 20 additions & 0 deletions lib/shared/decorations/crystal/dark_red_crystal.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import 'package:bonfire/bonfire.dart';
import 'package:warioddly/shared/decorations/crystal/crystal.dart';
import 'package:warioddly/shared/others/models/portfolio_model.dart';
import 'package:warioddly/shared/others/sprite_sheets/crystal_sprite_sheet.dart';
import 'package:flutter/material.dart';

class DarkRedCrystal extends Crystal {

DarkRedCrystal({
required Vector2 position,
ProjectModel? project,
}) : super(
project: project,
position: position,
sprite: CrystalSpriteSheet.darkRed,
color: Colors.redAccent.withOpacity(0.4),
);


}
19 changes: 19 additions & 0 deletions lib/shared/decorations/crystal/green_crystal.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import 'package:bonfire/bonfire.dart';
import 'package:warioddly/shared/decorations/crystal/crystal.dart';
import 'package:warioddly/shared/others/models/portfolio_model.dart';
import 'package:warioddly/shared/others/sprite_sheets/crystal_sprite_sheet.dart';
import 'package:flutter/material.dart';

class GreenCrystal extends Crystal {

GreenCrystal({
required Vector2 position,
ProjectModel? project,
}) : super(
project: project,
position: position,
sprite: CrystalSpriteSheet.green,
color: Colors.greenAccent.withOpacity(0.4),
);

}
19 changes: 19 additions & 0 deletions lib/shared/decorations/crystal/pink_crystal.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import 'package:bonfire/bonfire.dart';
import 'package:warioddly/shared/decorations/crystal/crystal.dart';
import 'package:warioddly/shared/others/models/portfolio_model.dart';
import 'package:warioddly/shared/others/sprite_sheets/crystal_sprite_sheet.dart';
import 'package:flutter/material.dart';

class PinkCrystal extends Crystal {

PinkCrystal({
required Vector2 position,
ProjectModel? project,
}) : super(
project: project,
position: position,
sprite: CrystalSpriteSheet.pink,
color: Colors.pinkAccent.withOpacity(0.4),
);

}
19 changes: 19 additions & 0 deletions lib/shared/decorations/crystal/red_crystal.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import 'package:bonfire/bonfire.dart';
import 'package:warioddly/shared/decorations/crystal/crystal.dart';
import 'package:warioddly/shared/others/models/portfolio_model.dart';
import 'package:warioddly/shared/others/sprite_sheets/crystal_sprite_sheet.dart';
import 'package:flutter/material.dart';

class RedCrystal extends Crystal {

RedCrystal({
required Vector2 position,
ProjectModel? project,
}) : super(
project: project,
position: position,
sprite: CrystalSpriteSheet.red,
color: Colors.redAccent.withOpacity(0.4),
);

}
19 changes: 19 additions & 0 deletions lib/shared/decorations/crystal/violet_crystal.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import 'package:bonfire/bonfire.dart';
import 'package:warioddly/shared/decorations/crystal/crystal.dart';
import 'package:warioddly/shared/others/models/portfolio_model.dart';
import 'package:warioddly/shared/others/sprite_sheets/crystal_sprite_sheet.dart';
import 'package:flutter/material.dart';

class VioletCrystal extends Crystal {

VioletCrystal({
required Vector2 position,
ProjectModel? project,
}) : super(
project: project,
position: position,
sprite: CrystalSpriteSheet.violet,
color: Colors.pinkAccent.withOpacity(0.4),
);

}
19 changes: 19 additions & 0 deletions lib/shared/decorations/crystal/yellow_crystal.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import 'package:bonfire/bonfire.dart';
import 'package:warioddly/shared/decorations/crystal/crystal.dart';
import 'package:warioddly/shared/others/models/portfolio_model.dart';
import 'package:warioddly/shared/others/sprite_sheets/crystal_sprite_sheet.dart';
import 'package:flutter/material.dart';

class YellowCrystal extends Crystal {

YellowCrystal({
required Vector2 position,
ProjectModel? project,
}) : super(
project: project,
position: position,
sprite: CrystalSpriteSheet.yellow,
color: Colors.yellowAccent.withOpacity(0.4),
);

}
Loading

0 comments on commit 31dfecd

Please sign in to comment.