add offline moving platform logic: implement dynamic platform detection and movement handling in offline mode
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 1m49s
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 1m49s
This commit is contained in:
@@ -218,6 +218,10 @@ func (c *ClientCollisionChecker) CheckCollision(x, y, w, h float64) (bool, strin
|
||||
for _, activeChunk := range c.ActiveChunks {
|
||||
if chunk, ok := c.World.ChunkLibrary[activeChunk.ChunkID]; ok {
|
||||
for _, obj := range chunk.Objects {
|
||||
if obj.MovingPlatform != nil {
|
||||
continue // Wird separat als MovingPlatform geprüft
|
||||
}
|
||||
|
||||
if assetDef, ok := c.World.Manifest.Assets[obj.AssetID]; ok {
|
||||
if assetDef.Hitbox.W > 0 && assetDef.Hitbox.H > 0 {
|
||||
colliderRect := game.Rect{
|
||||
@@ -228,7 +232,11 @@ func (c *ClientCollisionChecker) CheckCollision(x, y, w, h float64) (bool, strin
|
||||
}
|
||||
|
||||
if game.CheckRectCollision(playerRect, colliderRect) {
|
||||
return true, assetDef.Hitbox.Type
|
||||
colType := assetDef.Hitbox.Type
|
||||
if colType == "" {
|
||||
colType = assetDef.Type
|
||||
}
|
||||
return true, colType
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user