Player spawn point
This commit is contained in:
@ -1,11 +1,13 @@
|
||||
#ifndef CROCPARTY_GAME_MAP_H
|
||||
#define CROCPARTY_GAME_MAP_H
|
||||
|
||||
#include "game/game_collision.h"
|
||||
#include "sys/sys.h"
|
||||
|
||||
extern sys_i32 game_map_player_start_x;
|
||||
extern sys_i32 game_map_player_start_y;
|
||||
extern sys_map map_game_map;
|
||||
|
||||
void map_game_map_create_entities();
|
||||
#endif
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
"iid": "7db5fd20-b0a0-11ee-9688-af2c6adbc1d6",
|
||||
"jsonVersion": "1.5.3",
|
||||
"appBuildId": 473703,
|
||||
"nextUid": 108,
|
||||
"nextUid": 110,
|
||||
"identifierStyle": "Lowercase",
|
||||
"toc": [],
|
||||
"worldLayout": "Free",
|
||||
@ -3301,8 +3301,79 @@
|
||||
"tilePivotX": 0,
|
||||
"tilePivotY": 0,
|
||||
"biomeFieldUid": null
|
||||
},
|
||||
{
|
||||
"__type": "Entities",
|
||||
"identifier": "entities",
|
||||
"type": "Entities",
|
||||
"uid": 109,
|
||||
"doc": null,
|
||||
"uiColor": null,
|
||||
"gridSize": 8,
|
||||
"guideGridWid": 0,
|
||||
"guideGridHei": 0,
|
||||
"displayOpacity": 1,
|
||||
"inactiveOpacity": 0.6,
|
||||
"hideInList": false,
|
||||
"hideFieldsWhenInactive": true,
|
||||
"canSelectWhenInactive": true,
|
||||
"renderInWorldView": true,
|
||||
"pxOffsetX": 0,
|
||||
"pxOffsetY": 0,
|
||||
"parallaxFactorX": 0,
|
||||
"parallaxFactorY": 0,
|
||||
"parallaxScaling": true,
|
||||
"requiredTags": [],
|
||||
"excludedTags": [],
|
||||
"autoTilesKilledByOtherLayerUid": null,
|
||||
"uiFilterTags": [],
|
||||
"useAsyncRender": false,
|
||||
"intGridValues": [],
|
||||
"intGridValuesGroups": [],
|
||||
"autoRuleGroups": [],
|
||||
"autoSourceLayerDefUid": null,
|
||||
"tilesetDefUid": null,
|
||||
"tilePivotX": 0,
|
||||
"tilePivotY": 0,
|
||||
"biomeFieldUid": null
|
||||
}
|
||||
], "entities": [], "tilesets": [
|
||||
], "entities": [
|
||||
{
|
||||
"identifier": "player_spawn",
|
||||
"uid": 108,
|
||||
"tags": [],
|
||||
"exportToToc": false,
|
||||
"allowOutOfBounds": false,
|
||||
"doc": null,
|
||||
"width": 16,
|
||||
"height": 16,
|
||||
"resizableX": false,
|
||||
"resizableY": false,
|
||||
"minWidth": null,
|
||||
"maxWidth": null,
|
||||
"minHeight": null,
|
||||
"maxHeight": null,
|
||||
"keepAspectRatio": false,
|
||||
"tileOpacity": 1,
|
||||
"fillOpacity": 1,
|
||||
"lineOpacity": 1,
|
||||
"hollow": false,
|
||||
"color": "#BE4A2F",
|
||||
"renderMode": "Rectangle",
|
||||
"showName": true,
|
||||
"tilesetId": null,
|
||||
"tileRenderMode": "FitInside",
|
||||
"tileRect": null,
|
||||
"uiTileRect": null,
|
||||
"nineSliceBorders": [],
|
||||
"maxCount": 1,
|
||||
"limitScope": "PerWorld",
|
||||
"limitBehavior": "MoveLastOne",
|
||||
"pivotX": 0,
|
||||
"pivotY": 0,
|
||||
"fieldDefs": []
|
||||
}
|
||||
], "tilesets": [
|
||||
{
|
||||
"__cWid": 6,
|
||||
"__cHei": 20,
|
||||
@ -3761,6 +3832,48 @@
|
||||
"overrideTilesetUid": null,
|
||||
"gridTiles": [],
|
||||
"entityInstances": []
|
||||
},
|
||||
{
|
||||
"__identifier": "entities",
|
||||
"__type": "Entities",
|
||||
"__cWid": 32,
|
||||
"__cHei": 18,
|
||||
"__gridSize": 8,
|
||||
"__opacity": 1,
|
||||
"__pxTotalOffsetX": 0,
|
||||
"__pxTotalOffsetY": 0,
|
||||
"__tilesetDefUid": null,
|
||||
"__tilesetRelPath": null,
|
||||
"iid": "658f1a30-b0a0-11ee-9688-d595f6278eea",
|
||||
"levelId": 0,
|
||||
"layerDefUid": 109,
|
||||
"pxOffsetX": 0,
|
||||
"pxOffsetY": 0,
|
||||
"visible": true,
|
||||
"optionalRules": [],
|
||||
"intGridCsv": [],
|
||||
"autoLayerTiles": [],
|
||||
"seed": 9915028,
|
||||
"overrideTilesetUid": null,
|
||||
"gridTiles": [],
|
||||
"entityInstances": [
|
||||
{
|
||||
"__identifier": "player_spawn",
|
||||
"__grid": [15,7],
|
||||
"__pivot": [0,0],
|
||||
"__tags": [],
|
||||
"__tile": null,
|
||||
"__smartColor": "#BE4A2F",
|
||||
"iid": "86fd73b0-b0a0-11ee-9688-65c9ba3d6485",
|
||||
"width": 16,
|
||||
"height": 16,
|
||||
"defUid": 108,
|
||||
"px": [120,56],
|
||||
"fieldInstances": [],
|
||||
"__worldX": 120,
|
||||
"__worldY": 56
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"__neighbours": [{ "levelIid": "bf0dd810-b0a0-11ee-9688-3daed338bb0b", "dir": "e" }]
|
||||
@ -4097,6 +4210,31 @@
|
||||
"overrideTilesetUid": null,
|
||||
"gridTiles": [],
|
||||
"entityInstances": []
|
||||
},
|
||||
{
|
||||
"__identifier": "entities",
|
||||
"__type": "Entities",
|
||||
"__cWid": 32,
|
||||
"__cHei": 18,
|
||||
"__gridSize": 8,
|
||||
"__opacity": 1,
|
||||
"__pxTotalOffsetX": 0,
|
||||
"__pxTotalOffsetY": 0,
|
||||
"__tilesetDefUid": null,
|
||||
"__tilesetRelPath": null,
|
||||
"iid": "658f1a31-b0a0-11ee-9688-135042e10920",
|
||||
"levelId": 107,
|
||||
"layerDefUid": 109,
|
||||
"pxOffsetX": 0,
|
||||
"pxOffsetY": 0,
|
||||
"visible": true,
|
||||
"optionalRules": [],
|
||||
"intGridCsv": [],
|
||||
"autoLayerTiles": [],
|
||||
"seed": 8688237,
|
||||
"overrideTilesetUid": null,
|
||||
"gridTiles": [],
|
||||
"entityInstances": []
|
||||
}
|
||||
],
|
||||
"__neighbours": [{ "levelIid": "7db5fd22-b0a0-11ee-9688-e77df1dfa284", "dir": "w" }]
|
||||
|
12
game/map/game_map_entities.c
Normal file
12
game/map/game_map_entities.c
Normal file
@ -0,0 +1,12 @@
|
||||
#include "sys/sys.h"
|
||||
#include "game_map.h"
|
||||
|
||||
sys_i32 game_map_player_start_x;
|
||||
sys_i32 game_map_player_start_y;
|
||||
|
||||
// called by map_game_map_create_entities
|
||||
void map_game_map_player_spawn_create(sys_i32 x, sys_i32 y) {
|
||||
// center, because the entity has top-left positioning
|
||||
game_map_player_start_x = x * TILE_SZ_MICROPIXEL + PIXEL_SZ_MICROPIXEL * 8;
|
||||
game_map_player_start_y = y * TILE_SZ_MICROPIXEL + PIXEL_SZ_MICROPIXEL * 16;
|
||||
}
|
Reference in New Issue
Block a user