mirror of
https://github.com/sigonasr2/hamster.git
synced 2025-04-20 15:19:41 -05:00
Center powerup icons, cleanup border. Select correct tile ID for rendering checkpoints.
This commit is contained in:
parent
fefbbceef4
commit
98e0aa804f
Binary file not shown.
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 4.4 KiB |
Binary file not shown.
@ -126,7 +126,7 @@ void HamsterGame::LoadLevel(const std::string&mapName){
|
|||||||
const int tileID{layer.tiles[y][x]-1};
|
const int tileID{layer.tiles[y][x]-1};
|
||||||
if(Powerup::TileIDIsUpperLeftPowerupTile(tileID))mapPowerups.emplace_back(vf2d{float(x),float(y)}*16+vf2d{16,16},Powerup::TileIDPowerupType(tileID));
|
if(Powerup::TileIDIsUpperLeftPowerupTile(tileID))mapPowerups.emplace_back(vf2d{float(x),float(y)}*16+vf2d{16,16},Powerup::TileIDPowerupType(tileID));
|
||||||
|
|
||||||
if(tileID==1485)checkpoints.emplace_back(vf2d{float(x),float(y)}*16+vf2d{48,64});
|
if(tileID==1484)checkpoints.emplace_back(vf2d{float(x),float(y)}*16+vf2d{64,64});
|
||||||
|
|
||||||
const int numTilesWide{GetGFX("gametiles.png").Sprite()->width/16};
|
const int numTilesWide{GetGFX("gametiles.png").Sprite()->width/16};
|
||||||
const int numTilesTall{GetGFX("gametiles.png").Sprite()->height/16};
|
const int numTilesTall{GetGFX("gametiles.png").Sprite()->height/16};
|
||||||
@ -187,7 +187,7 @@ void HamsterGame::DrawGame(){
|
|||||||
for(int y:std::ranges::iota_view(0,4)){
|
for(int y:std::ranges::iota_view(0,4)){
|
||||||
for(int x:std::ranges::iota_view(0,2)){
|
for(int x:std::ranges::iota_view(0,2)){
|
||||||
const int powerupInd{y*2+x};
|
const int powerupInd{y*2+x};
|
||||||
const float drawX{x*32.f+12.f};
|
const float drawX{x*32.f+20.f};
|
||||||
const float drawY{y*32.f+12.f+96.f};
|
const float drawY{y*32.f+12.f+96.f};
|
||||||
const Powerup::PowerupType powerupType{Powerup::PowerupType(powerupInd)};
|
const Powerup::PowerupType powerupType{Powerup::PowerupType(powerupInd)};
|
||||||
const geom2d::rect<float>powerupSubimageRect{Powerup::GetPowerupSubimageRect(powerupType)};
|
const geom2d::rect<float>powerupSubimageRect{Powerup::GetPowerupSubimageRect(powerupType)};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user