-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
821 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"sheets": [ | ||
{ | ||
"name": "achievements", | ||
"columns": [ | ||
{ | ||
"typeStr": "0", | ||
"name": "Id" | ||
}, | ||
{ | ||
"typeStr": "1", | ||
"name": "Name", | ||
"display": null | ||
}, | ||
{ | ||
"typeStr": "1", | ||
"name": "Description", | ||
"display": null | ||
}, | ||
{ | ||
"typeStr": "7", | ||
"name": "Picture", | ||
"opt": true, | ||
"display": null | ||
}, | ||
{ | ||
"typeStr": "1", | ||
"name": "steamID", | ||
"opt": true | ||
}, | ||
{ | ||
"typeStr": "1", | ||
"name": "xboxID", | ||
"opt": true | ||
}, | ||
{ | ||
"typeStr": "1", | ||
"name": "psID", | ||
"display": null | ||
} | ||
], | ||
"lines": [ | ||
{ | ||
"Name": "test", | ||
"psID": "qsd", | ||
"steamID": "sd", | ||
"xboxID": "sd", | ||
"Id": "test" | ||
} | ||
], | ||
"separators": [], | ||
"props": {} | ||
} | ||
], | ||
"customTypes": [], | ||
"compress": false | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ "frames": { | ||
"grill_stick.aseprite": { | ||
"frame": { "x": 0, "y": 0, "w": 128, "h": 128 }, | ||
"rotated": false, | ||
"trimmed": false, | ||
"spriteSourceSize": { "x": 0, "y": 0, "w": 128, "h": 128 }, | ||
"sourceSize": { "w": 128, "h": 128 }, | ||
"duration": 100 | ||
} | ||
}, | ||
"meta": { | ||
"app": "https://www.aseprite.org/", | ||
"version": "1.3.10.1-x64", | ||
"image": "grill_stick.png", | ||
"format": "RGBA8888", | ||
"size": { "w": 128, "h": 128 }, | ||
"scale": "1", | ||
"frameTags": [ | ||
{ "name": "idle", "from": 0, "to": 0, "direction": "forward", "color": "#000000ff" } | ||
], | ||
"layers": [ | ||
{ "name": "Layer 1", "opacity": 255, "blendMode": "normal" }, | ||
{ "name": "Layer 2", "opacity": 255, "blendMode": "normal" } | ||
], | ||
"slices": [ | ||
] | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{ "frames": { | ||
"marshmallow 0.aseprite": { | ||
"frame": { "x": 0, "y": 0, "w": 64, "h": 64 }, | ||
"rotated": false, | ||
"trimmed": false, | ||
"spriteSourceSize": { "x": 0, "y": 0, "w": 64, "h": 64 }, | ||
"sourceSize": { "w": 64, "h": 64 }, | ||
"duration": 100 | ||
}, | ||
"marshmallow 1.aseprite": { | ||
"frame": { "x": 64, "y": 0, "w": 64, "h": 64 }, | ||
"rotated": false, | ||
"trimmed": false, | ||
"spriteSourceSize": { "x": 0, "y": 0, "w": 64, "h": 64 }, | ||
"sourceSize": { "w": 64, "h": 64 }, | ||
"duration": 100 | ||
}, | ||
"marshmallow 2.aseprite": { | ||
"frame": { "x": 128, "y": 0, "w": 64, "h": 64 }, | ||
"rotated": false, | ||
"trimmed": false, | ||
"spriteSourceSize": { "x": 0, "y": 0, "w": 64, "h": 64 }, | ||
"sourceSize": { "w": 64, "h": 64 }, | ||
"duration": 100 | ||
}, | ||
"marshmallow 3.aseprite": { | ||
"frame": { "x": 192, "y": 0, "w": 64, "h": 64 }, | ||
"rotated": false, | ||
"trimmed": false, | ||
"spriteSourceSize": { "x": 0, "y": 0, "w": 64, "h": 64 }, | ||
"sourceSize": { "w": 64, "h": 64 }, | ||
"duration": 100 | ||
}, | ||
"marshmallow 4.aseprite": { | ||
"frame": { "x": 256, "y": 0, "w": 64, "h": 64 }, | ||
"rotated": false, | ||
"trimmed": false, | ||
"spriteSourceSize": { "x": 0, "y": 0, "w": 64, "h": 64 }, | ||
"sourceSize": { "w": 64, "h": 64 }, | ||
"duration": 100 | ||
}, | ||
"marshmallow 5.aseprite": { | ||
"frame": { "x": 320, "y": 0, "w": 64, "h": 64 }, | ||
"rotated": false, | ||
"trimmed": false, | ||
"spriteSourceSize": { "x": 0, "y": 0, "w": 64, "h": 64 }, | ||
"sourceSize": { "w": 64, "h": 64 }, | ||
"duration": 100 | ||
}, | ||
"marshmallow 6.aseprite": { | ||
"frame": { "x": 384, "y": 0, "w": 64, "h": 64 }, | ||
"rotated": false, | ||
"trimmed": false, | ||
"spriteSourceSize": { "x": 0, "y": 0, "w": 64, "h": 64 }, | ||
"sourceSize": { "w": 64, "h": 64 }, | ||
"duration": 100 | ||
} | ||
}, | ||
"meta": { | ||
"app": "https://www.aseprite.org/", | ||
"version": "1.3.10.1-x64", | ||
"image": "marshmallow.png", | ||
"format": "RGBA8888", | ||
"size": { "w": 448, "h": 64 }, | ||
"scale": "1", | ||
"frameTags": [ | ||
], | ||
"layers": [ | ||
{ "name": "Layer 1", "opacity": 255, "blendMode": "normal" } | ||
], | ||
"slices": [ | ||
] | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
package activities; | ||
|
||
import activities.ActivityAreaInstance; | ||
import activities.bonfire.BonfireArea; | ||
import entities.Player; | ||
import entities.base.BaseUser; | ||
import haxe.Constraints; | ||
import levels.LDTKLevel; | ||
import levels.TankmasLevel; | ||
import net.tankmas.NetDefs.NetEventDef; | ||
|
||
typedef ActivityType = levels.LdtkProject.Enum_ActivityType; | ||
|
||
enum AreaShape | ||
{ | ||
Circle; | ||
Rectangle; | ||
} | ||
|
||
class ActivityArea extends FlxSprite | ||
{ | ||
var active_players:Map<String, ActivityAreaInstance> = new Map(); | ||
var activity_type:ActivityType; | ||
var shape:AreaShape; | ||
|
||
public function new(type:ActivityType, X, Y, w, h, shape = AreaShape.Circle) | ||
{ | ||
super(X, Y); | ||
this.activity_type = type; | ||
height = h; | ||
width = w; | ||
this.shape = shape; | ||
PlayState.self.activity_areas.add(this); | ||
} | ||
|
||
public function in_area(x:Float, y:Float) | ||
{ | ||
switch (shape) | ||
{ | ||
case Circle: | ||
var dx = x - this.x; | ||
var dy = y - this.y; | ||
var r = width * 0.5; | ||
var rr = r * r; | ||
var dist_sq = dx * dx + dy * dy; | ||
return dist_sq < rr; | ||
case Rectangle: | ||
if (x < this.x) | ||
return false; | ||
if (y < this.y) | ||
return false; | ||
if (x > this.x + width) | ||
return false; | ||
if (y > this.y + height) | ||
return false; | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
function create_instance(player:BaseUser) | ||
{ | ||
switch (activity_type) | ||
{ | ||
case Bonfire: | ||
return new BonfireArea(player, this); | ||
} | ||
} | ||
|
||
public function on_enter(player:BaseUser) | ||
{ | ||
if (active_players[player.username] != null) | ||
return; | ||
|
||
var area = create_instance(player); | ||
|
||
active_players[player.username] = area; | ||
} | ||
|
||
public function on_leave(player:BaseUser) | ||
{ | ||
var area = active_players[player.username]; | ||
if (area == null) | ||
return; | ||
|
||
area.on_leave(); | ||
active_players[player.username] = null; | ||
} | ||
|
||
public function on_event(event:NetEventDef, player:BaseUser) | ||
{ | ||
var area = active_players[player.username]; | ||
if (area == null) | ||
return; | ||
area.on_event(event); | ||
} | ||
|
||
// Happens when the local player presses the interact button | ||
public function on_interact(player:Player) | ||
{ | ||
var area = active_players[player.username]; | ||
if (area == null) | ||
return; | ||
area.on_interact(); | ||
} | ||
|
||
override function kill() | ||
{ | ||
PlayState.self.activity_areas.remove(this, true); | ||
super.kill(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package activities; | ||
|
||
import entities.base.BaseUser; | ||
import net.tankmas.NetDefs.NetEventDef; | ||
|
||
class ActivityAreaInstance extends FlxSprite | ||
{ | ||
var player:BaseUser; | ||
var activity_area:ActivityArea; | ||
|
||
public function new(player:BaseUser, activity_area:ActivityArea) | ||
{ | ||
super(activity_area.x, activity_area.y); | ||
this.player = player; | ||
this.activity_area = activity_area; | ||
} | ||
|
||
public function on_leave() {} | ||
|
||
public function on_interact() {} | ||
|
||
public function on_event(event:NetEventDef) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package activities.bonfire; | ||
|
||
import entities.base.BaseUser; | ||
import net.tankmas.NetDefs.NetEventDef; | ||
import net.tankmas.NetDefs.NetEventType; | ||
import net.tankmas.OnlineLoop; | ||
|
||
class BonfireArea extends ActivityAreaInstance | ||
{ | ||
var stick: BonfireStick; | ||
var local: Bool; | ||
public function new(player:BaseUser, area:ActivityArea) | ||
{ | ||
super(player, area); | ||
local = player == PlayState.self.player; | ||
stick = new BonfireStick(player, this); | ||
stick.activate(); | ||
} | ||
|
||
override function on_leave() { | ||
super.on_leave(); | ||
stick.hide(); | ||
destroy(); | ||
} | ||
|
||
override function on_interact() { | ||
var marshmallow = stick.marshmallow; | ||
if (marshmallow != null) { | ||
OnlineLoop.post_marshmallow_discard(Main.current_room_id, marshmallow.current_level); | ||
} | ||
stick.shake_off(); | ||
} | ||
|
||
override function on_event(event:NetEventDef) { | ||
super.on_event(event); | ||
if (local) return; | ||
if (event.type == NetEventType.DROP_MARSHMALLOW) { | ||
var level: Int = cast(event.data.level, Int); | ||
if (stick.marshmallow != null) { | ||
stick.marshmallow.set_level(level); | ||
} | ||
stick.shake_off(); | ||
} | ||
} | ||
} |
Oops, something went wrong.