Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 23 additions & 14 deletions examples/game/assets/game_ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@
"sourceSize": {"w":472,"h":484},
"pivot": {"x":0.5,"y":0.5}
},
{
"filename": "coinboard.png",
"frame": {"x":366,"y":1056,"w":261,"h":100},
"rotated": true,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":261,"h":100},
"sourceSize": {"w":261,"h":100},
"pivot": {"x":0.5,"y":0.5}
},
{
"filename": "number_0.png",
"frame": {"x":416,"y":954,"w":38,"h":63},
Expand All @@ -47,7 +56,7 @@
},
{
"filename": "number_1.png",
"frame": {"x":324,"y":1221,"w":16,"h":57},
"frame": {"x":299,"y":1286,"w":16,"h":57},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":45,"y":25,"w":16,"h":57},
Expand All @@ -56,7 +65,7 @@
},
{
"filename": "number_2.png",
"frame": {"x":366,"y":1056,"w":38,"h":63},
"frame": {"x":324,"y":1156,"w":38,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":23,"y":22,"w":38,"h":63},
Expand All @@ -65,25 +74,25 @@
},
{
"filename": "number_3.png",
"frame": {"x":364,"y":1156,"w":35,"h":63},
"rotated": false,
"frame": {"x":197,"y":1230,"w":35,"h":63},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":26,"y":22,"w":35,"h":63},
"sourceSize": {"w":84,"h":107},
"pivot": {"x":0.5,"y":0.5}
},
{
"filename": "number_4.png",
"frame": {"x":416,"y":1019,"w":38,"h":57},
"rotated": false,
"frame": {"x":197,"y":1267,"w":38,"h":57},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":23,"y":25,"w":38,"h":57},
"sourceSize": {"w":84,"h":107},
"pivot": {"x":0.5,"y":0.5}
},
{
"filename": "number_5.png",
"frame": {"x":324,"y":1156,"w":38,"h":63},
"frame": {"x":324,"y":1221,"w":38,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":23,"y":22,"w":38,"h":63},
Expand All @@ -92,7 +101,7 @@
},
{
"filename": "number_6.png",
"frame": {"x":406,"y":1078,"w":38,"h":63},
"frame": {"x":2,"y":1230,"w":38,"h":63},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":23,"y":22,"w":38,"h":63},
Expand All @@ -101,16 +110,16 @@
},
{
"filename": "number_7.png",
"frame": {"x":401,"y":1198,"w":35,"h":60},
"rotated": true,
"frame": {"x":262,"y":1230,"w":35,"h":60},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":26,"y":22,"w":35,"h":60},
"sourceSize": {"w":84,"h":107},
"pivot": {"x":0.5,"y":0.5}
},
{
"filename": "number_8.png",
"frame": {"x":406,"y":1118,"w":38,"h":63},
"frame": {"x":67,"y":1230,"w":38,"h":63},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":23,"y":22,"w":38,"h":63},
Expand All @@ -119,7 +128,7 @@
},
{
"filename": "number_9.png",
"frame": {"x":401,"y":1158,"w":38,"h":63},
"frame": {"x":132,"y":1230,"w":38,"h":63},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":23,"y":22,"w":38,"h":63},
Expand All @@ -140,8 +149,8 @@
"version": "1.0",
"image": "game_ui.png",
"format": "RGBA8888",
"size": {"w":472,"h":1239},
"size": {"w":472,"h":1319},
"scale": "1",
"smartupdate": "$TexturePacker:SmartUpdate:02d6676bdde949110cbdc9a2c385b33a:6b0974f94eba9593dd9636cc730412b8:10ac111e32c27e51f4e8444dbb39eff6$"
"smartupdate": "$TexturePacker:SmartUpdate:2fc7dfe766eba152274e2661737d6b51:b44b32d1e0a4146b3591d51b12f2d7ae:10ac111e32c27e51f4e8444dbb39eff6$"
}
}
Binary file modified examples/game/assets/game_ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 49 additions & 22 deletions examples/game/assets/sprites.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
{
"filename": "asteroid_big_0.png",
"frame": {"x":260,"y":193,"w":200,"h":167},
"frame": {"x":2,"y":450,"w":200,"h":167},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":21,"w":200,"h":167},
Expand All @@ -20,7 +20,7 @@
},
{
"filename": "asteroid_big_1.nrm.png",
"frame": {"x":451,"y":2,"w":204,"h":166},
"frame": {"x":2,"y":619,"w":204,"h":166},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":204,"h":166},
Expand All @@ -29,7 +29,7 @@
},
{
"filename": "asteroid_big_1.png",
"frame": {"x":657,"y":2,"w":204,"h":166},
"frame": {"x":2,"y":787,"w":204,"h":166},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":204,"h":166},
Expand All @@ -38,7 +38,7 @@
},
{
"filename": "asteroid_big_2.nrm.png",
"frame": {"x":462,"y":170,"w":194,"h":165},
"frame": {"x":204,"y":335,"w":194,"h":165},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":194,"h":165},
Expand All @@ -47,7 +47,7 @@
},
{
"filename": "asteroid_big_2.png",
"frame": {"x":658,"y":170,"w":194,"h":165},
"frame": {"x":208,"y":502,"w":194,"h":165},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":2,"w":194,"h":165},
Expand All @@ -56,7 +56,7 @@
},
{
"filename": "asteroid_small_0.nrm.png",
"frame": {"x":204,"y":362,"w":102,"h":84},
"frame": {"x":347,"y":843,"w":102,"h":84},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":102,"h":84},
Expand All @@ -65,7 +65,7 @@
},
{
"filename": "asteroid_small_0.png",
"frame": {"x":308,"y":362,"w":102,"h":84},
"frame": {"x":347,"y":929,"w":102,"h":84},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":102,"h":84},
Expand All @@ -74,7 +74,7 @@
},
{
"filename": "asteroid_small_1.nrm.png",
"frame": {"x":854,"y":213,"w":96,"h":102},
"frame": {"x":404,"y":463,"w":96,"h":102},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":96,"h":102},
Expand All @@ -83,7 +83,7 @@
},
{
"filename": "asteroid_small_1.png",
"frame": {"x":854,"y":317,"w":96,"h":102},
"frame": {"x":404,"y":567,"w":96,"h":102},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":0,"w":96,"h":102},
Expand All @@ -92,7 +92,7 @@
},
{
"filename": "asteroid_small_2.nrm.png",
"frame": {"x":740,"y":337,"w":109,"h":84},
"frame": {"x":347,"y":671,"w":109,"h":84},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":109,"h":84},
Expand All @@ -101,16 +101,43 @@
},
{
"filename": "asteroid_small_2.png",
"frame": {"x":740,"y":423,"w":109,"h":84},
"frame": {"x":347,"y":757,"w":109,"h":84},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":109,"h":84},
"sourceSize": {"w":109,"h":84},
"pivot": {"x":0.5,"y":0.5}
},
{
"filename": "coin.png",
"frame": {"x":429,"y":270,"w":42,"h":47},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":4,"w":42,"h":47},
"sourceSize": {"w":54,"h":56},
"pivot": {"x":0.5,"y":0.5}
},
{
"filename": "enemy_destroyer_1.png",
"frame": {"x":260,"y":193,"w":167,"h":140},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":10,"y":31,"w":167,"h":140},
"sourceSize": {"w":188,"h":188},
"pivot": {"x":0.5,"y":0.5}
},
{
"filename": "enemy_scout_0.png",
"frame": {"x":400,"y":335,"w":107,"h":126},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":11,"y":1,"w":107,"h":126},
"sourceSize": {"w":129,"h":129},
"pivot": {"x":0.5,"y":0.5}
},
{
"filename": "explosion_flare.png",
"frame": {"x":863,"y":2,"w":56,"h":209},
"frame": {"x":451,"y":2,"w":56,"h":209},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":4,"y":0,"w":56,"h":209},
Expand All @@ -119,7 +146,7 @@
},
{
"filename": "explosion_particle.png",
"frame": {"x":2,"y":450,"w":36,"h":60},
"frame": {"x":204,"y":260,"w":36,"h":60},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":14,"y":1,"w":36,"h":60},
Expand All @@ -137,7 +164,7 @@
},
{
"filename": "fire_particle.png",
"frame": {"x":40,"y":450,"w":55,"h":55},
"frame": {"x":429,"y":213,"w":55,"h":55},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":4,"y":4,"w":55,"h":55},
Expand All @@ -146,7 +173,7 @@
},
{
"filename": "laser.png",
"frame": {"x":204,"y":260,"w":37,"h":76},
"frame": {"x":458,"y":671,"w":37,"h":76},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":37,"h":76},
Expand All @@ -164,7 +191,7 @@
},
{
"filename": "ship.nrm.png",
"frame": {"x":462,"y":337,"w":137,"h":167},
"frame": {"x":208,"y":669,"w":137,"h":167},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":137,"h":167},
Expand All @@ -173,7 +200,7 @@
},
{
"filename": "ship.png",
"frame": {"x":601,"y":337,"w":137,"h":167},
"frame": {"x":208,"y":838,"w":137,"h":167},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":25,"y":10,"w":137,"h":167},
Expand All @@ -182,7 +209,7 @@
},
{
"filename": "star_0.png",
"frame": {"x":204,"y":448,"w":62,"h":62},
"frame": {"x":2,"y":955,"w":62,"h":62},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":1,"y":1,"w":62,"h":62},
Expand All @@ -191,7 +218,7 @@
},
{
"filename": "star_1.png",
"frame": {"x":268,"y":448,"w":62,"h":62},
"frame": {"x":66,"y":955,"w":62,"h":62},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":1,"y":1,"w":62,"h":62},
Expand All @@ -200,7 +227,7 @@
},
{
"filename": "star_2.png",
"frame": {"x":332,"y":448,"w":62,"h":62},
"frame": {"x":130,"y":955,"w":62,"h":62},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":1,"y":1,"w":62,"h":62},
Expand All @@ -212,8 +239,8 @@
"version": "1.0",
"image": "sprites.png",
"format": "RGBA8888",
"size": {"w":952,"h":512},
"size": {"w":509,"h":1019},
"scale": "1",
"smartupdate": "$TexturePacker:SmartUpdate:342fc72defddab59bb356b48894e2931:ecb4b4fa7772ea6a35788ebf670ca27c:1eabdf11f75e3a4fe3147baf7b5be24b$"
"smartupdate": "$TexturePacker:SmartUpdate:2164a72d7de59aa3603277aa505ff73b:f339feca6ccc1f78132ecc733c94dbc5:1eabdf11f75e3a4fe3147baf7b5be24b$"
}
}
Binary file modified examples/game/assets/sprites.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions examples/game/lib/custom_actions.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
part of game;

class ActionCircularMove extends ActionInterval {
ActionCircularMove(this.setter, this.center, this.radius, this.startAngle, this.clockWise, double duration) : super (duration);

final Function setter;
final Point center;
final double radius;
final double startAngle;
final bool clockWise;

void update(double t) {
if (!clockWise) t = -t;
double rad = radians(startAngle + t * 360.0);
Offset offset = new Offset(math.cos(rad) * radius, math.sin(rad) * radius);
Point pos = center + offset;
setter(pos);
}
}
12 changes: 11 additions & 1 deletion examples/game/lib/explosions.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
part of game;

class Explosion extends Node {
Explosion(SpriteSheet sheet) {
Explosion() {
zPosition = 10.0;
}
}

class ExplosionBig extends Explosion {
ExplosionBig(SpriteSheet sheet) {
// Add particles
ParticleSystem particlesDebris = new ParticleSystem(
sheet["explosion_particle.png"],
Expand Down Expand Up @@ -69,3 +75,7 @@ class Explosion extends Node {
}
}
}

class ExplosionMini extends Explosion {

}
2 changes: 2 additions & 0 deletions examples/game/lib/game_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import 'dart:sky' as sky;
import 'package:sky/rendering/object.dart';
import 'package:sky/widgets/framework.dart';
import 'package:skysprites/skysprites.dart';
import 'package:vector_math/vector_math.dart';

part 'custom_actions.dart';
part 'explosions.dart';
part 'flash.dart';
part 'game_demo_node.dart';
Expand Down
Loading