Lighting experiments
This commit is contained in:
@@ -10,7 +10,8 @@ import (
|
||||
|
||||
func CreateDesert(screenWidth, screenHeight float64) *Map {
|
||||
m := NewMap("desert", 2, "Desert", screenWidth, screenHeight)
|
||||
m.BackgroundColor = color.NRGBA{R: 155, G: 196, B: 215, A: 255}
|
||||
m.BackgroundColor = color.NRGBA{R: 15, G: 20, B: 40, A: 255} // Dark blue night sky
|
||||
m.TimeOfDay = Nighttime
|
||||
|
||||
// ground surface
|
||||
m.World.AddSurface(&world.Surface{
|
||||
@@ -22,6 +23,49 @@ func CreateDesert(screenWidth, screenHeight float64) *Map {
|
||||
Color: color.NRGBA{R: 139, G: 69, B: 19, A: 255},
|
||||
})
|
||||
|
||||
// Platforms - sandy brown color
|
||||
platformColor := color.NRGBA{R: 194, G: 134, B: 64, A: 255}
|
||||
|
||||
// Platform 1: Low left
|
||||
m.World.AddSurface(&world.Surface{
|
||||
X: 120,
|
||||
Y: screenHeight - 110,
|
||||
Width: 140,
|
||||
Height: 20,
|
||||
Tag: world.TagPlatform,
|
||||
Color: platformColor,
|
||||
})
|
||||
|
||||
// Platform 2: Mid center-left
|
||||
m.World.AddSurface(&world.Surface{
|
||||
X: 320,
|
||||
Y: screenHeight - 180,
|
||||
Width: 180,
|
||||
Height: 20,
|
||||
Tag: world.TagPlatform,
|
||||
Color: platformColor,
|
||||
})
|
||||
|
||||
// Platform 3: High center-right
|
||||
m.World.AddSurface(&world.Surface{
|
||||
X: 580,
|
||||
Y: screenHeight - 230,
|
||||
Width: 160,
|
||||
Height: 20,
|
||||
Tag: world.TagPlatform,
|
||||
Color: platformColor,
|
||||
})
|
||||
|
||||
// Platform 4: Mid right
|
||||
m.World.AddSurface(&world.Surface{
|
||||
X: 720,
|
||||
Y: screenHeight - 140,
|
||||
Width: 140,
|
||||
Height: 20,
|
||||
Tag: world.TagPlatform,
|
||||
Color: platformColor,
|
||||
})
|
||||
|
||||
// left portal to plains
|
||||
leftPortal := portal.CreateSidePortal("desert_left", portal.SideLeft, screenWidth, screenHeight)
|
||||
leftPortal.DestinationMap = "plains"
|
||||
|
||||
@@ -3,9 +3,16 @@ package maps
|
||||
import (
|
||||
"image/color"
|
||||
|
||||
"github.com/hajimehoshi/ebiten/v2"
|
||||
"github.com/atridad/LilGuy/internal/portal"
|
||||
"github.com/atridad/LilGuy/internal/world"
|
||||
"github.com/hajimehoshi/ebiten/v2"
|
||||
)
|
||||
|
||||
type TimeOfDay string
|
||||
|
||||
const (
|
||||
Daytime TimeOfDay = "day"
|
||||
Nighttime TimeOfDay = "night"
|
||||
)
|
||||
|
||||
type Map struct {
|
||||
@@ -17,6 +24,7 @@ type Map struct {
|
||||
World *world.World
|
||||
Portals []*portal.Portal
|
||||
BackgroundColor color.NRGBA
|
||||
TimeOfDay TimeOfDay // Day or Night tag
|
||||
|
||||
bakedImage *ebiten.Image
|
||||
}
|
||||
@@ -31,6 +39,7 @@ func NewMap(id string, number int, displayName string, width, height float64) *M
|
||||
World: world.NewWorld(),
|
||||
Portals: make([]*portal.Portal, 0),
|
||||
BackgroundColor: color.NRGBA{R: 135, G: 206, B: 235, A: 255},
|
||||
TimeOfDay: Daytime, // Default to daytime
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
func CreatePlains(screenWidth, screenHeight float64) *Map {
|
||||
m := NewMap("plains", 1, "Plains", screenWidth, screenHeight)
|
||||
m.BackgroundColor = color.NRGBA{R: 135, G: 206, B: 235, A: 255}
|
||||
m.TimeOfDay = Daytime
|
||||
|
||||
// ground surface
|
||||
groundColor := color.NRGBA{R: 34, G: 139, B: 34, A: 255}
|
||||
|
||||
Reference in New Issue
Block a user