Changes:
- use toggle tile for all toggling entities (transient, switch, door) - get rod of hard coded sprites (exception: particle class, to be fixed later) - changed switch sprite (rect instead of elipse)
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
Description: open the door
|
||||
MinMoves: 2
|
||||
Background: background-lila
|
||||
|
||||
|
||||
|
||||
#######
|
||||
#o #
|
||||
# t #
|
||||
#> S <#
|
||||
# #
|
||||
# ^ #
|
||||
#######
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
Description: test obstacles
|
||||
MinMoves: 14
|
||||
Background: background-lila
|
||||
|
||||
|
||||
|
||||
#############
|
||||
# t #
|
||||
#> S # #
|
||||
# ># ^#
|
||||
#< #W#####
|
||||
# o v# o#
|
||||
#############
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
Description: collect all yellow dots
|
||||
MinMoves: 7
|
||||
Background: background-lila
|
||||
|
||||
|
||||
# ############
|
||||
# #
|
||||
############ #
|
||||
# o S #
|
||||
# ######## ###
|
||||
+ #
|
||||
############ #
|
||||
# o # #
|
||||
# # ######## #
|
||||
# # o
|
||||
# ############
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
Description: some enemies can be moved
|
||||
MinMoves: 5
|
||||
Background: background-lila
|
||||
|
||||
|
||||
|
||||
|
||||
########
|
||||
# o <o#
|
||||
#v S # #
|
||||
# #### #
|
||||
|
||||
|
||||
# #### #
|
||||
# #
|
||||
# ^#
|
||||
########
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
Description: the more players the better
|
||||
MinMoves: 4
|
||||
Background: background-lila
|
||||
|
||||
|
||||
|
||||
|
||||
########W#
|
||||
# v#
|
||||
# #
|
||||
#S s#
|
||||
############
|
||||
# o #
|
||||
######## #
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
Description: don't fall off the world
|
||||
MinMoves: 3
|
||||
Background: background-lila
|
||||
|
||||
|
||||
|
||||
|
||||
W
|
||||
|
||||
|
||||
S # o
|
||||
|
||||
|
||||
|
||||
|
||||
o
|
||||
#
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
#!/bin/bash
|
||||
width=$(grep "width " ../../main.go | awk '{print $4}')
|
||||
height=$(grep "height " ../../main.go | awk '{print $4}')
|
||||
|
||||
read -p " Enter level name: " name
|
||||
read -p " Enter background: " background
|
||||
read -p "Enter description: " des
|
||||
|
||||
if test -z "$name"; then
|
||||
name="newlevel"
|
||||
fi
|
||||
|
||||
if test -z "$bbackground"; then
|
||||
background="background-lila"
|
||||
fi
|
||||
|
||||
w=$(($width/32))
|
||||
h=$(($height/32))
|
||||
|
||||
(
|
||||
echo "Description: $des"
|
||||
echo "Background: $background"
|
||||
|
||||
for x in $(seq 1 $h); do
|
||||
for y in $(seq 1 $w); do
|
||||
echo -n " "
|
||||
done
|
||||
echo
|
||||
done
|
||||
)
|
||||
@@ -11,7 +11,7 @@
|
||||
"iid": "267e9380-d7b0-11ee-a97e-35bec9c19d52",
|
||||
"jsonVersion": "1.5.3",
|
||||
"appBuildId": 473703,
|
||||
"nextUid": 70,
|
||||
"nextUid": 76,
|
||||
"identifierStyle": "Capitalize",
|
||||
"toc": [],
|
||||
"worldLayout": "Free",
|
||||
@@ -425,7 +425,48 @@
|
||||
"limitBehavior": "MoveLastOne",
|
||||
"pivotX": 0,
|
||||
"pivotY": 0,
|
||||
"fieldDefs": []
|
||||
"fieldDefs": [
|
||||
{
|
||||
"identifier": "Toggle",
|
||||
"doc": null,
|
||||
"__type": "Tile",
|
||||
"uid": 75,
|
||||
"type": "F_Tile",
|
||||
"isArray": false,
|
||||
"canBeNull": true,
|
||||
"arrayMinLength": null,
|
||||
"arrayMaxLength": null,
|
||||
"editorDisplayMode": "Hidden",
|
||||
"editorDisplayScale": 1,
|
||||
"editorDisplayPos": "Above",
|
||||
"editorLinkStyle": "StraightArrow",
|
||||
"editorDisplayColor": null,
|
||||
"editorAlwaysShow": false,
|
||||
"editorShowInWorld": true,
|
||||
"editorCutLongValues": true,
|
||||
"editorTextSuffix": null,
|
||||
"editorTextPrefix": null,
|
||||
"useForSmartColor": false,
|
||||
"exportToToc": false,
|
||||
"searchable": false,
|
||||
"min": null,
|
||||
"max": null,
|
||||
"regex": null,
|
||||
"acceptFileTypes": null,
|
||||
"defaultOverride": {
|
||||
"id": "V_String",
|
||||
"params": ["64,128,32,32"]
|
||||
},
|
||||
"textLanguageMode": null,
|
||||
"symmetricalRef": false,
|
||||
"autoChainRef": true,
|
||||
"allowOutOfLevelRef": true,
|
||||
"allowedRefs": "OnlySame",
|
||||
"allowedRefsEntityUid": null,
|
||||
"allowedRefTags": [],
|
||||
"tilesetUid": 57
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"identifier": "Switch",
|
||||
@@ -468,7 +509,7 @@
|
||||
"uid": 69,
|
||||
"type": "F_EntityRef",
|
||||
"isArray": false,
|
||||
"canBeNull": true,
|
||||
"canBeNull": false,
|
||||
"arrayMinLength": null,
|
||||
"arrayMaxLength": null,
|
||||
"editorDisplayMode": "RefLinkBetweenCenters",
|
||||
@@ -497,6 +538,46 @@
|
||||
"allowedRefsEntityUid": 65,
|
||||
"allowedRefTags": [],
|
||||
"tilesetUid": null
|
||||
},
|
||||
{
|
||||
"identifier": "Toggle",
|
||||
"doc": null,
|
||||
"__type": "Tile",
|
||||
"uid": 74,
|
||||
"type": "F_Tile",
|
||||
"isArray": false,
|
||||
"canBeNull": true,
|
||||
"arrayMinLength": null,
|
||||
"arrayMaxLength": null,
|
||||
"editorDisplayMode": "Hidden",
|
||||
"editorDisplayScale": 1,
|
||||
"editorDisplayPos": "Above",
|
||||
"editorLinkStyle": "StraightArrow",
|
||||
"editorDisplayColor": null,
|
||||
"editorAlwaysShow": false,
|
||||
"editorShowInWorld": true,
|
||||
"editorCutLongValues": true,
|
||||
"editorTextSuffix": null,
|
||||
"editorTextPrefix": null,
|
||||
"useForSmartColor": false,
|
||||
"exportToToc": false,
|
||||
"searchable": false,
|
||||
"min": null,
|
||||
"max": null,
|
||||
"regex": null,
|
||||
"acceptFileTypes": null,
|
||||
"defaultOverride": {
|
||||
"id": "V_String",
|
||||
"params": ["96,192,32,32"]
|
||||
},
|
||||
"textLanguageMode": null,
|
||||
"symmetricalRef": false,
|
||||
"autoChainRef": true,
|
||||
"allowOutOfLevelRef": true,
|
||||
"allowedRefs": "OnlySame",
|
||||
"allowedRefsEntityUid": null,
|
||||
"allowedRefTags": [],
|
||||
"tilesetUid": 57
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -570,6 +651,46 @@
|
||||
"allowedRefsEntityUid": 66,
|
||||
"allowedRefTags": [],
|
||||
"tilesetUid": null
|
||||
},
|
||||
{
|
||||
"identifier": "Toggle",
|
||||
"doc": null,
|
||||
"__type": "Tile",
|
||||
"uid": 71,
|
||||
"type": "F_Tile",
|
||||
"isArray": false,
|
||||
"canBeNull": true,
|
||||
"arrayMinLength": null,
|
||||
"arrayMaxLength": null,
|
||||
"editorDisplayMode": "Hidden",
|
||||
"editorDisplayScale": 1,
|
||||
"editorDisplayPos": "Above",
|
||||
"editorLinkStyle": "StraightArrow",
|
||||
"editorDisplayColor": null,
|
||||
"editorAlwaysShow": false,
|
||||
"editorShowInWorld": true,
|
||||
"editorCutLongValues": true,
|
||||
"editorTextSuffix": null,
|
||||
"editorTextPrefix": null,
|
||||
"useForSmartColor": false,
|
||||
"exportToToc": false,
|
||||
"searchable": false,
|
||||
"min": null,
|
||||
"max": null,
|
||||
"regex": null,
|
||||
"acceptFileTypes": null,
|
||||
"defaultOverride": {
|
||||
"id": "V_String",
|
||||
"params": ["64,192,32,32"]
|
||||
},
|
||||
"textLanguageMode": null,
|
||||
"symmetricalRef": false,
|
||||
"autoChainRef": true,
|
||||
"allowOutOfLevelRef": true,
|
||||
"allowedRefs": "OnlySame",
|
||||
"allowedRefsEntityUid": null,
|
||||
"allowedRefTags": [],
|
||||
"tilesetUid": 57
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -1053,13 +1174,13 @@
|
||||
},
|
||||
{
|
||||
"__cWid": 4,
|
||||
"__cHei": 6,
|
||||
"__cHei": 7,
|
||||
"identifier": "Entitymap",
|
||||
"uid": 57,
|
||||
"relPath": "../sprites/entitymap.png",
|
||||
"embedAtlas": null,
|
||||
"pxWid": 128,
|
||||
"pxHei": 192,
|
||||
"pxHei": 224,
|
||||
"tileGridSize": 32,
|
||||
"spacing": 0,
|
||||
"padding": 0,
|
||||
@@ -1069,8 +1190,8 @@
|
||||
"customData": [],
|
||||
"savedSelections": [],
|
||||
"cachedPixelData": {
|
||||
"opaqueTiles": "000000000111111111111100",
|
||||
"averageColors": "1b47987d687d3b355c355c355c355c353c96faa8f166f299f5b7f853f799f777f222f888f444f765f555f53200000000"
|
||||
"opaqueTiles": "0000000001111111111111000000",
|
||||
"averageColors": "1b47987d687d3b355c355c355c355c353c96faa8f166f299f5b7f853f799f777f222f888f444f765f555f532e866ab85000000003743aa95"
|
||||
}
|
||||
}
|
||||
], "enums": [], "externalEnums": [], "levelFields": [
|
||||
@@ -3960,7 +4081,7 @@
|
||||
"height": 32,
|
||||
"defUid": 24,
|
||||
"px": [192,224],
|
||||
"fieldInstances": [],
|
||||
"fieldInstances": [{ "__identifier": "Toggle", "__type": "Tile", "__value": { "tilesetUid": 57, "x": 64, "y": 128, "w": 32, "h": 32 }, "__tile": null, "defUid": 75, "realEditorValues": [] }],
|
||||
"__worldX": -32,
|
||||
"__worldY": 1856
|
||||
},
|
||||
@@ -3976,7 +4097,7 @@
|
||||
"height": 32,
|
||||
"defUid": 24,
|
||||
"px": [320,320],
|
||||
"fieldInstances": [],
|
||||
"fieldInstances": [{ "__identifier": "Toggle", "__type": "Tile", "__value": { "tilesetUid": 57, "x": 64, "y": 128, "w": 32, "h": 32 }, "__tile": null, "defUid": 75, "realEditorValues": [] }],
|
||||
"__worldX": 96,
|
||||
"__worldY": 1952
|
||||
},
|
||||
@@ -4040,7 +4161,7 @@
|
||||
"height": 32,
|
||||
"defUid": 24,
|
||||
"px": [416,224],
|
||||
"fieldInstances": [],
|
||||
"fieldInstances": [{ "__identifier": "Toggle", "__type": "Tile", "__value": { "tilesetUid": 57, "x": 64, "y": 128, "w": 32, "h": 32 }, "__tile": null, "defUid": 75, "realEditorValues": [] }],
|
||||
"__worldX": 192,
|
||||
"__worldY": 1856
|
||||
}
|
||||
@@ -4200,7 +4321,7 @@
|
||||
"height": 32,
|
||||
"defUid": 24,
|
||||
"px": [192,224],
|
||||
"fieldInstances": [],
|
||||
"fieldInstances": [{ "__identifier": "Toggle", "__type": "Tile", "__value": { "tilesetUid": 57, "x": 64, "y": 128, "w": 32, "h": 32 }, "__tile": null, "defUid": 75, "realEditorValues": [] }],
|
||||
"__worldX": 672,
|
||||
"__worldY": 1856
|
||||
},
|
||||
@@ -4280,7 +4401,7 @@
|
||||
"height": 32,
|
||||
"defUid": 24,
|
||||
"px": [192,96],
|
||||
"fieldInstances": [],
|
||||
"fieldInstances": [{ "__identifier": "Toggle", "__type": "Tile", "__value": { "tilesetUid": 57, "x": 64, "y": 128, "w": 32, "h": 32 }, "__tile": null, "defUid": 75, "realEditorValues": [] }],
|
||||
"__worldX": 672,
|
||||
"__worldY": 1728
|
||||
},
|
||||
@@ -4486,7 +4607,7 @@
|
||||
"height": 32,
|
||||
"defUid": 24,
|
||||
"px": [64,224],
|
||||
"fieldInstances": [],
|
||||
"fieldInstances": [{ "__identifier": "Toggle", "__type": "Tile", "__value": { "tilesetUid": 57, "x": 64, "y": 128, "w": 32, "h": 32 }, "__tile": null, "defUid": 75, "realEditorValues": [] }],
|
||||
"__worldX": 1248,
|
||||
"__worldY": 1856
|
||||
},
|
||||
@@ -4518,7 +4639,7 @@
|
||||
"height": 32,
|
||||
"defUid": 24,
|
||||
"px": [128,160],
|
||||
"fieldInstances": [],
|
||||
"fieldInstances": [{ "__identifier": "Toggle", "__type": "Tile", "__value": { "tilesetUid": 57, "x": 64, "y": 128, "w": 32, "h": 32 }, "__tile": null, "defUid": 75, "realEditorValues": [] }],
|
||||
"__worldX": 1312,
|
||||
"__worldY": 1792
|
||||
},
|
||||
@@ -4841,7 +4962,7 @@
|
||||
"height": 32,
|
||||
"defUid": 24,
|
||||
"px": [416,96],
|
||||
"fieldInstances": [],
|
||||
"fieldInstances": [{ "__identifier": "Toggle", "__type": "Tile", "__value": { "tilesetUid": 57, "x": 64, "y": 128, "w": 32, "h": 32 }, "__tile": null, "defUid": 75, "realEditorValues": [] }],
|
||||
"__worldX": 2304,
|
||||
"__worldY": 1728
|
||||
},
|
||||
@@ -4857,7 +4978,7 @@
|
||||
"height": 32,
|
||||
"defUid": 24,
|
||||
"px": [416,352],
|
||||
"fieldInstances": [],
|
||||
"fieldInstances": [{ "__identifier": "Toggle", "__type": "Tile", "__value": { "tilesetUid": 57, "x": 64, "y": 128, "w": 32, "h": 32 }, "__tile": null, "defUid": 75, "realEditorValues": [] }],
|
||||
"__worldX": 2304,
|
||||
"__worldY": 1984
|
||||
},
|
||||
@@ -4905,7 +5026,7 @@
|
||||
"height": 32,
|
||||
"defUid": 24,
|
||||
"px": [288,128],
|
||||
"fieldInstances": [],
|
||||
"fieldInstances": [{ "__identifier": "Toggle", "__type": "Tile", "__value": { "tilesetUid": 57, "x": 64, "y": 128, "w": 32, "h": 32 }, "__tile": null, "defUid": 75, "realEditorValues": [] }],
|
||||
"__worldX": 2176,
|
||||
"__worldY": 1760
|
||||
},
|
||||
@@ -4921,7 +5042,7 @@
|
||||
"height": 32,
|
||||
"defUid": 24,
|
||||
"px": [192,256],
|
||||
"fieldInstances": [],
|
||||
"fieldInstances": [{ "__identifier": "Toggle", "__type": "Tile", "__value": { "tilesetUid": 57, "x": 64, "y": 128, "w": 32, "h": 32 }, "__tile": null, "defUid": 75, "realEditorValues": [] }],
|
||||
"__worldX": 2080,
|
||||
"__worldY": 1888
|
||||
},
|
||||
@@ -4937,7 +5058,7 @@
|
||||
"height": 32,
|
||||
"defUid": 24,
|
||||
"px": [480,288],
|
||||
"fieldInstances": [],
|
||||
"fieldInstances": [{ "__identifier": "Toggle", "__type": "Tile", "__value": { "tilesetUid": 57, "x": 64, "y": 128, "w": 32, "h": 32 }, "__tile": null, "defUid": 75, "realEditorValues": [] }],
|
||||
"__worldX": 2368,
|
||||
"__worldY": 1920
|
||||
},
|
||||
@@ -4953,7 +5074,7 @@
|
||||
"height": 32,
|
||||
"defUid": 24,
|
||||
"px": [480,64],
|
||||
"fieldInstances": [],
|
||||
"fieldInstances": [{ "__identifier": "Toggle", "__type": "Tile", "__value": { "tilesetUid": 57, "x": 64, "y": 128, "w": 32, "h": 32 }, "__tile": null, "defUid": 75, "realEditorValues": [] }],
|
||||
"__worldX": 2368,
|
||||
"__worldY": 1696
|
||||
},
|
||||
@@ -4969,7 +5090,7 @@
|
||||
"height": 32,
|
||||
"defUid": 24,
|
||||
"px": [512,128],
|
||||
"fieldInstances": [],
|
||||
"fieldInstances": [{ "__identifier": "Toggle", "__type": "Tile", "__value": { "tilesetUid": 57, "x": 64, "y": 128, "w": 32, "h": 32 }, "__tile": null, "defUid": 75, "realEditorValues": [] }],
|
||||
"__worldX": 2400,
|
||||
"__worldY": 1760
|
||||
},
|
||||
@@ -6072,15 +6193,18 @@
|
||||
"height": 32,
|
||||
"defUid": 66,
|
||||
"px": [352,160],
|
||||
"fieldInstances": [{ "__identifier": "Entity_ref", "__type": "EntityRef", "__value": {
|
||||
"entityIid": "81e502b0-d7b0-11ee-9add-6193c766edeb",
|
||||
"layerIid": "50624190-d7b0-11ee-968e-3dbcbdc42f40",
|
||||
"levelIid": "50621a80-d7b0-11ee-968e-a98c2d35fbdb",
|
||||
"worldIid": "267ee1a0-d7b0-11ee-a97e-53f0a359eae1"
|
||||
}, "__tile": null, "defUid": 69, "realEditorValues": [{
|
||||
"id": "V_String",
|
||||
"params": ["81e502b0-d7b0-11ee-9add-6193c766edeb"]
|
||||
}] }],
|
||||
"fieldInstances": [
|
||||
{ "__identifier": "Entity_ref", "__type": "EntityRef", "__value": {
|
||||
"entityIid": "81e502b0-d7b0-11ee-9add-6193c766edeb",
|
||||
"layerIid": "50624190-d7b0-11ee-968e-3dbcbdc42f40",
|
||||
"levelIid": "50621a80-d7b0-11ee-968e-a98c2d35fbdb",
|
||||
"worldIid": "267ee1a0-d7b0-11ee-a97e-53f0a359eae1"
|
||||
}, "__tile": null, "defUid": 69, "realEditorValues": [{
|
||||
"id": "V_String",
|
||||
"params": ["81e502b0-d7b0-11ee-9add-6193c766edeb"]
|
||||
}] },
|
||||
{ "__identifier": "Toggle", "__type": "Tile", "__value": { "tilesetUid": 57, "x": 96, "y": 192, "w": 32, "h": 32 }, "__tile": null, "defUid": 74, "realEditorValues": [] }
|
||||
],
|
||||
"__worldX": 128,
|
||||
"__worldY": 2912
|
||||
},
|
||||
@@ -6096,15 +6220,10 @@
|
||||
"height": 32,
|
||||
"defUid": 65,
|
||||
"px": [224,224],
|
||||
"fieldInstances": [{ "__identifier": "Entity_ref", "__type": "EntityRef", "__value": {
|
||||
"entityIid": "7d975370-d7b0-11ee-9add-971995295000",
|
||||
"layerIid": "50624190-d7b0-11ee-968e-3dbcbdc42f40",
|
||||
"levelIid": "50621a80-d7b0-11ee-968e-a98c2d35fbdb",
|
||||
"worldIid": "267ee1a0-d7b0-11ee-a97e-53f0a359eae1"
|
||||
}, "__tile": null, "defUid": 68, "realEditorValues": [{
|
||||
"id": "V_String",
|
||||
"params": ["7d975370-d7b0-11ee-9add-971995295000"]
|
||||
}] }],
|
||||
"fieldInstances": [
|
||||
{ "__identifier": "Entity_ref", "__type": "EntityRef", "__value": null, "__tile": null, "defUid": 68, "realEditorValues": [null] },
|
||||
{ "__identifier": "Toggle", "__type": "Tile", "__value": { "tilesetUid": 57, "x": 64, "y": 192, "w": 32, "h": 32 }, "__tile": null, "defUid": 71, "realEditorValues": [] }
|
||||
],
|
||||
"__worldX": 0,
|
||||
"__worldY": 2976
|
||||
},
|
||||
|
||||
@@ -17,53 +17,53 @@ var Tiles = InitTiles()
|
||||
// Tile: contains image, identifier (as used in level data) and
|
||||
// additional properties
|
||||
type Tile struct {
|
||||
Id, Ref string
|
||||
Sprite *ebiten.Image
|
||||
Class string
|
||||
Solid bool // wall brick
|
||||
Player bool // player sphere
|
||||
IsPrimary bool // primary player sphere
|
||||
Renderable bool // visible, has sprite
|
||||
Velocity bool // movable
|
||||
Collectible bool // collectible, vanishes once collected
|
||||
Transient bool // turns into brick wall when traversed
|
||||
Destroyable bool // turns into empty floor when bumped into twice
|
||||
Particle int // -1=unused, 0-3 = show image of slice
|
||||
Tiles []*ebiten.Image // has N sprites
|
||||
TileNames []string // same thing, only the names
|
||||
Obstacle bool // is an obstacle/enemy
|
||||
Direction int // obstacle business end shows into this direction
|
||||
Shader *ebiten.Shader
|
||||
Alpha *ebiten.Image
|
||||
Bond bool // denotes an entity which can have a relation to another
|
||||
Door bool // a door, can be manipulated by a switch
|
||||
Switch bool // opens|closes a door
|
||||
Id, Ref string
|
||||
Sprite *ebiten.Image
|
||||
ToggleSprite *ebiten.Image
|
||||
Solid bool // wall brick
|
||||
Player bool // player sphere
|
||||
IsPrimary bool // primary player sphere
|
||||
Renderable bool // visible, has sprite
|
||||
Velocity bool // movable
|
||||
Collectible bool // collectible, vanishes once collected
|
||||
Transient bool // turns into brick wall when traversed
|
||||
Destroyable bool // turns into empty floor when bumped into twice
|
||||
Particle int // -1=unused, 0-3 = show image of slice
|
||||
Tiles []*ebiten.Image // has N sprites
|
||||
TileNames []string // same thing, only the names
|
||||
Obstacle bool // is an obstacle/enemy
|
||||
Direction int // obstacle business end shows into this direction
|
||||
Shader *ebiten.Shader
|
||||
Alpha *ebiten.Image
|
||||
Bond bool // denotes an entity which can have a relation to another
|
||||
Door bool // a door, can be manipulated by a switch
|
||||
Switch bool // opens|closes a door
|
||||
}
|
||||
|
||||
func (tile *Tile) Clone() *Tile {
|
||||
newtile := &Tile{
|
||||
Id: tile.Id,
|
||||
Ref: tile.Ref,
|
||||
Sprite: tile.Sprite,
|
||||
Class: tile.Class,
|
||||
Solid: tile.Solid,
|
||||
Player: tile.Player,
|
||||
IsPrimary: tile.IsPrimary,
|
||||
Renderable: tile.Renderable,
|
||||
Velocity: tile.Velocity,
|
||||
Collectible: tile.Collectible,
|
||||
Transient: tile.Transient,
|
||||
Destroyable: tile.Destroyable,
|
||||
Particle: tile.Particle,
|
||||
Tiles: tile.Tiles,
|
||||
TileNames: tile.TileNames,
|
||||
Obstacle: tile.Obstacle,
|
||||
Direction: tile.Direction,
|
||||
Alpha: tile.Alpha,
|
||||
Shader: tile.Shader,
|
||||
Bond: tile.Bond,
|
||||
Door: tile.Door,
|
||||
Switch: tile.Switch,
|
||||
Id: tile.Id,
|
||||
Ref: tile.Ref,
|
||||
Sprite: tile.Sprite,
|
||||
ToggleSprite: tile.ToggleSprite,
|
||||
Solid: tile.Solid,
|
||||
Player: tile.Player,
|
||||
IsPrimary: tile.IsPrimary,
|
||||
Renderable: tile.Renderable,
|
||||
Velocity: tile.Velocity,
|
||||
Collectible: tile.Collectible,
|
||||
Transient: tile.Transient,
|
||||
Destroyable: tile.Destroyable,
|
||||
Particle: tile.Particle,
|
||||
Tiles: tile.Tiles,
|
||||
TileNames: tile.TileNames,
|
||||
Obstacle: tile.Obstacle,
|
||||
Direction: tile.Direction,
|
||||
Alpha: tile.Alpha,
|
||||
Shader: tile.Shader,
|
||||
Bond: tile.Bond,
|
||||
Door: tile.Door,
|
||||
Switch: tile.Switch,
|
||||
}
|
||||
|
||||
return newtile
|
||||
@@ -86,7 +86,6 @@ func GetSprites(class []string) []*ebiten.Image {
|
||||
|
||||
func NewTilePlayer(isprimary bool) *Tile {
|
||||
tile := &Tile{
|
||||
Class: "sphere",
|
||||
Renderable: true,
|
||||
Player: true,
|
||||
Velocity: true,
|
||||
@@ -105,29 +104,23 @@ func NewTilePlayer(isprimary bool) *Tile {
|
||||
return tile
|
||||
}
|
||||
|
||||
func NewTileBlock(class string) *Tile {
|
||||
func NewTileBlock() *Tile {
|
||||
return &Tile{
|
||||
Sprite: Assets[class],
|
||||
Class: class,
|
||||
Solid: true,
|
||||
Renderable: true,
|
||||
}
|
||||
}
|
||||
|
||||
func NewTileCollectible(class string) *Tile {
|
||||
func NewTileCollectible() *Tile {
|
||||
return &Tile{
|
||||
Sprite: Assets[class],
|
||||
Class: class,
|
||||
Solid: false,
|
||||
Renderable: true,
|
||||
Collectible: true,
|
||||
}
|
||||
}
|
||||
|
||||
func NewTileObstacle(class string, direction int) *Tile {
|
||||
func NewTileObstacle(direction int) *Tile {
|
||||
return &Tile{
|
||||
Sprite: Assets[class],
|
||||
Class: class,
|
||||
Solid: false,
|
||||
Renderable: true,
|
||||
Obstacle: true,
|
||||
@@ -140,7 +133,6 @@ func NewTileParticle(class []string) *Tile {
|
||||
sprites := GetSprites(class)
|
||||
|
||||
return &Tile{
|
||||
Class: "particle",
|
||||
Solid: false,
|
||||
Renderable: false,
|
||||
Particle: 0,
|
||||
@@ -148,57 +140,39 @@ func NewTileParticle(class []string) *Tile {
|
||||
}
|
||||
}
|
||||
|
||||
func NewTileTranswall(class []string) *Tile {
|
||||
sprites := GetSprites(class)
|
||||
|
||||
func NewTileTranswall() *Tile {
|
||||
return &Tile{
|
||||
Class: "transwall",
|
||||
Solid: false,
|
||||
Renderable: true,
|
||||
Transient: true,
|
||||
Tiles: sprites,
|
||||
Sprite: sprites[0], // initially use the first
|
||||
TileNames: class,
|
||||
}
|
||||
}
|
||||
|
||||
func NewTileHiddenDoor(class, alpha string) *Tile {
|
||||
func NewTileHiddenDoor(alpha string) *Tile {
|
||||
return &Tile{
|
||||
Class: "hiddendoor",
|
||||
Solid: false,
|
||||
Renderable: true,
|
||||
Destroyable: true,
|
||||
Sprite: Assets[class],
|
||||
Alpha: Assets[alpha],
|
||||
Shader: Shaders["destruct"],
|
||||
}
|
||||
}
|
||||
|
||||
func NewTileSwitch(class []string) *Tile {
|
||||
sprites := GetSprites(class)
|
||||
|
||||
func NewTileSwitch() *Tile {
|
||||
return &Tile{
|
||||
Class: "switch",
|
||||
Solid: false,
|
||||
Renderable: true,
|
||||
Bond: true,
|
||||
Switch: true,
|
||||
Tiles: sprites,
|
||||
Sprite: sprites[0], // initially use the first
|
||||
}
|
||||
}
|
||||
|
||||
func NewTileDoor(class []string) *Tile {
|
||||
sprites := GetSprites(class)
|
||||
|
||||
func NewTileDoor() *Tile {
|
||||
return &Tile{
|
||||
Class: "door",
|
||||
Solid: false,
|
||||
Renderable: true,
|
||||
Bond: true,
|
||||
Door: true,
|
||||
Tiles: sprites,
|
||||
Sprite: sprites[0], // initially use the first
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,17 +181,17 @@ type TileRegistry map[string]*Tile
|
||||
|
||||
func InitTiles() TileRegistry {
|
||||
return TileRegistry{
|
||||
"floor": {Class: "floor", Renderable: false},
|
||||
"default": NewTileBlock("block-greycolored"),
|
||||
"solidorange": NewTileBlock("block-orange-32"),
|
||||
"floor": {Renderable: false},
|
||||
"default": NewTileBlock(),
|
||||
"solidorange": NewTileBlock(),
|
||||
"PlayerPrimary": NewTilePlayer(Primary),
|
||||
"PlayerSecondary": NewTilePlayer(Secondary),
|
||||
"Collectible": NewTileCollectible("collectible-orange"),
|
||||
"ObstacleStar": NewTileObstacle("obstacle-star", config.All),
|
||||
"ObstacleNorth": NewTileObstacle("obstacle-north", config.North),
|
||||
"ObstacleSouth": NewTileObstacle("obstacle-south", config.South),
|
||||
"ObstacleWest": NewTileObstacle("obstacle-west", config.West),
|
||||
"ObstacleEast": NewTileObstacle("obstacle-east", config.East),
|
||||
"Collectible": NewTileCollectible(),
|
||||
"ObstacleStar": NewTileObstacle(config.All),
|
||||
"ObstacleNorth": NewTileObstacle(config.North),
|
||||
"ObstacleSouth": NewTileObstacle(config.South),
|
||||
"ObstacleWest": NewTileObstacle(config.West),
|
||||
"ObstacleEast": NewTileObstacle(config.East),
|
||||
"Particle": NewTileParticle([]string{
|
||||
"particle-ring-1",
|
||||
"particle-ring-2",
|
||||
@@ -226,22 +200,22 @@ func InitTiles() TileRegistry {
|
||||
"particle-ring-5",
|
||||
"particle-ring-6",
|
||||
}),
|
||||
"Transient": NewTileTranswall([]string{"transwall", "block-orange-32"}),
|
||||
"HiddenDoor": NewTileHiddenDoor("block-greycolored", "damage"),
|
||||
"HiddenDoor2": NewTileHiddenDoor("block-greycolored", "damage"),
|
||||
"HiddenDoor3": NewTileHiddenDoor("block-greycolored", "damage"),
|
||||
"HiddenDoor4": NewTileHiddenDoor("block-greycolored", "damage"),
|
||||
"HiddenDoor5": NewTileHiddenDoor("block-greycolored", "damage"),
|
||||
"HiddenDoor6": NewTileHiddenDoor("block-greycolored", "damage"),
|
||||
"HiddenDoor7": NewTileHiddenDoor("block-greycolored", "damage"),
|
||||
"HiddenDoor8": NewTileHiddenDoor("block-greycolored", "damage"),
|
||||
"HiddenDoor9": NewTileHiddenDoor("block-greycolored", "damage"),
|
||||
"HiddenDoor10": NewTileHiddenDoor("block-greycolored", "damage"),
|
||||
"HiddenDoor11": NewTileHiddenDoor("block-greycolored", "damage"),
|
||||
"HiddenDoor12": NewTileHiddenDoor("block-greycolored", "damage"),
|
||||
"HiddenDoor13": NewTileHiddenDoor("block-greycolored", "damage"),
|
||||
"Switch": NewTileSwitch([]string{"switch1", "switch2"}),
|
||||
"Door": NewTileDoor([]string{"door1", "door2"}),
|
||||
"Transient": NewTileTranswall(),
|
||||
"HiddenDoor": NewTileHiddenDoor("damage"),
|
||||
"HiddenDoor2": NewTileHiddenDoor("damage"),
|
||||
"HiddenDoor3": NewTileHiddenDoor("damage"),
|
||||
"HiddenDoor4": NewTileHiddenDoor("damage"),
|
||||
"HiddenDoor5": NewTileHiddenDoor("damage"),
|
||||
"HiddenDoor6": NewTileHiddenDoor("damage"),
|
||||
"HiddenDoor7": NewTileHiddenDoor("damage"),
|
||||
"HiddenDoor8": NewTileHiddenDoor("damage"),
|
||||
"HiddenDoor9": NewTileHiddenDoor("damage"),
|
||||
"HiddenDoor10": NewTileHiddenDoor("damage"),
|
||||
"HiddenDoor11": NewTileHiddenDoor("damage"),
|
||||
"HiddenDoor12": NewTileHiddenDoor("damage"),
|
||||
"HiddenDoor13": NewTileHiddenDoor("damage"),
|
||||
"Switch": NewTileSwitch(),
|
||||
"Door": NewTileDoor(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 33 KiB |
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 508 B After Width: | Height: | Size: 503 B |
Binary file not shown.
|
Before Width: | Height: | Size: 532 B After Width: | Height: | Size: 543 B |
BIN
assets/sprites/woddendoor.ase
Normal file
BIN
assets/sprites/woddendoor.ase
Normal file
Binary file not shown.
Reference in New Issue
Block a user