Teleport code added in Wizard. Needs more debugging.
This commit is contained in:
+8
-4
@@ -107,11 +107,10 @@ bool Crawler::OnUserCreate(){
|
||||
player.AddAnimation(AnimationState::WIZARD_ATTACK_W);
|
||||
view=TileTransformedView{GetScreenSize(),{1,1}};
|
||||
|
||||
player.SetClass(WARRIOR);
|
||||
player.SetPos({4*24,4*24});
|
||||
|
||||
LoadLevel(CAMPAIGN_1_1);
|
||||
|
||||
player.SetClass(WARRIOR);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -875,7 +874,6 @@ void Crawler::LoadLevel(MapName map){
|
||||
SPAWNER_LIST.clear();
|
||||
foregroundTileGroups.clear();
|
||||
currentLevel=map;
|
||||
player.SetPos(MAP_DATA[map].MapData.playerSpawnLocation);
|
||||
WORLD_SIZE={MAP_DATA[map].MapData.width,MAP_DATA[map].MapData.height};
|
||||
for(SpawnerTag&spawner:MAP_DATA[map].SpawnerData){
|
||||
std::vector<std::pair<MonsterName,vf2d>>monster_list;
|
||||
@@ -919,6 +917,7 @@ void Crawler::LoadLevel(MapName map){
|
||||
}
|
||||
}
|
||||
}
|
||||
player.SetPos(MAP_DATA[map].MapData.playerSpawnLocation);
|
||||
}
|
||||
|
||||
vi2d Crawler::GetWorldSize(){
|
||||
@@ -949,6 +948,11 @@ TilesheetData Crawler::GetTileSheet(MapName map,int tileID){
|
||||
}
|
||||
}
|
||||
|
||||
bool Crawler::HasTileCollision(MapName map,vf2d pos){
|
||||
geom2d::rect<int>collisionRect=GetTileCollision(map,pos);
|
||||
return collisionRect.pos==NO_COLLISION.pos&&collisionRect.size==NO_COLLISION.size;
|
||||
}
|
||||
|
||||
geom2d::rect<int>Crawler::GetTileCollision(MapName map,vf2d pos){
|
||||
for(LayerTag&layer:MAP_DATA[map].LayerData){
|
||||
int tileID=layer.tiles[int(pos.y)/24][int(pos.x)/24]-1;
|
||||
|
||||
Reference in New Issue
Block a user