| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203 |
- Add-Type -AssemblyName System.Drawing
- $out = Join-Path $PSScriptRoot '..\assets\resources\sprites'
- New-Item -ItemType Directory -Force $out | Out-Null
- function Color($hex, $alpha = 255) {
- $hex = $hex.TrimStart('#')
- [System.Drawing.Color]::FromArgb($alpha, [Convert]::ToInt32($hex.Substring(0,2),16), [Convert]::ToInt32($hex.Substring(2,2),16), [Convert]::ToInt32($hex.Substring(4,2),16))
- }
- function Save-Png($name, $w, $h, [scriptblock]$draw) {
- $bmp = New-Object System.Drawing.Bitmap $w, $h, ([System.Drawing.Imaging.PixelFormat]::Format32bppArgb)
- $g = [System.Drawing.Graphics]::FromImage($bmp)
- $g.SmoothingMode = [System.Drawing.Drawing2D.SmoothingMode]::AntiAlias
- $g.InterpolationMode = [System.Drawing.Drawing2D.InterpolationMode]::NearestNeighbor
- & $draw $g $w $h
- $path = Join-Path $out "$name.png"
- $bmp.Save($path, [System.Drawing.Imaging.ImageFormat]::Png)
- $g.Dispose()
- $bmp.Dispose()
- }
- function Brush($hex, $alpha = 255) { New-Object System.Drawing.SolidBrush (Color $hex $alpha) }
- function PenC($hex, $width = 1, $alpha = 255) { New-Object System.Drawing.Pen (Color $hex $alpha), $width }
- Save-Png 'bg_jungle' 2048 540 {
- param($g,$w,$h)
- $rect = New-Object System.Drawing.Rectangle 0,0,$w,$h
- $bg = New-Object System.Drawing.Drawing2D.LinearGradientBrush $rect,(Color '#101738'),(Color '#123a32'),90
- $g.FillRectangle($bg,$rect)
- for ($i=0; $i -lt 85; $i++) {
- $x = ($i * 73) % $w
- $top = 40 + (($i * 29) % 170)
- $height = 260 + (($i * 47) % 220)
- $green = if ($i % 2 -eq 0) { '#1f7352' } else { '#285e68' }
- $g.FillEllipse((Brush $green 110), $x-55, $top, 120, $height)
- $g.FillRectangle((Brush '#0b292b' 180), $x-7, $top+80, 14, $height)
- }
- for ($i=0; $i -lt 42; $i++) {
- $x = ($i * 149) % $w
- $y = 110 + (($i * 61) % 280)
- $g.FillEllipse((Brush '#73f6ff' 70), $x, $y, 8, 8)
- $g.FillEllipse((Brush '#ff4fc3' 45), $x+22, $y+12, 5, 5)
- }
- for ($i=0; $i -lt 9; $i++) {
- $x = $i * 245 + 80
- $g.FillPolygon((Brush '#273a5d' 190), @(
- [System.Drawing.PointF]::new($x,245),
- [System.Drawing.PointF]::new($x+170,225),
- [System.Drawing.PointF]::new($x+230,330),
- [System.Drawing.PointF]::new($x+40,348)
- ))
- $g.DrawLine((PenC '#69f8ff' 2 140), $x+32, 270, $x+178, 256)
- }
- }
- Save-Png 'ground_strip' 512 96 {
- param($g,$w,$h)
- $g.Clear((Color '#162d35'))
- $g.FillRectangle((Brush '#2a6645'),0,0,$w,30)
- $g.FillRectangle((Brush '#173730'),0,30,$w,66)
- for ($i=0; $i -lt 34; $i++) {
- $x = $i * 16
- $g.FillPolygon((Brush '#6ee08d' 180), @(
- [System.Drawing.PointF]::new($x,24),
- [System.Drawing.PointF]::new($x+8,4),
- [System.Drawing.PointF]::new($x+15,24)
- ))
- }
- for ($i=0; $i -lt 28; $i++) {
- $x = ($i * 37) % $w
- $y = 42 + (($i * 19) % 42)
- $g.FillEllipse((Brush '#49f5ff' 70),$x,$y,8,5)
- }
- }
- Save-Png 'player' 96 112 {
- param($g,$w,$h)
- $g.Clear([System.Drawing.Color]::Transparent)
- $g.FillEllipse((Brush '#49f5ff' 42), 17, 14, 62, 82)
- $g.FillRectangle((Brush '#26384a'), 35, 39, 31, 38)
- $g.FillRectangle((Brush '#46d9ff'), 39, 32, 23, 19)
- $g.FillRectangle((Brush '#121923'), 42, 35, 17, 7)
- $g.FillRectangle((Brush '#f7d16a'), 50, 53, 31, 10)
- $g.FillRectangle((Brush '#596c76'), 72, 55, 20, 6)
- $g.FillRectangle((Brush '#29384a'), 29, 73, 13, 28)
- $g.FillRectangle((Brush '#29384a'), 57, 73, 13, 28)
- $g.FillRectangle((Brush '#f052a8'), 31, 42, 7, 31)
- $g.DrawRectangle((PenC '#9dfbff' 3), 35, 39, 31, 38)
- }
- Save-Png 'enemy_spore' 80 80 {
- param($g,$w,$h)
- $g.Clear([System.Drawing.Color]::Transparent)
- $g.FillEllipse((Brush '#f05098' 88), 6, 12, 68, 56)
- $g.FillEllipse((Brush '#7330a4'), 13, 18, 54, 44)
- $g.FillEllipse((Brush '#a8ff5c'), 23, 27, 11, 11)
- $g.FillEllipse((Brush '#a8ff5c'), 48, 29, 9, 9)
- $g.DrawArc((PenC '#ff8fd6' 4), 12, 16, 55, 44, 200, 140)
- $g.FillPolygon((Brush '#341b4d'), @([System.Drawing.PointF]::new(23,59),[System.Drawing.PointF]::new(33,76),[System.Drawing.PointF]::new(42,59)))
- $g.FillPolygon((Brush '#341b4d'), @([System.Drawing.PointF]::new(46,59),[System.Drawing.PointF]::new(58,74),[System.Drawing.PointF]::new(62,58)))
- }
- Save-Png 'enemy_wing' 92 78 {
- param($g,$w,$h)
- $g.Clear([System.Drawing.Color]::Transparent)
- $g.FillPolygon((Brush '#50f4ff' 105), @([System.Drawing.PointF]::new(9,26),[System.Drawing.PointF]::new(38,9),[System.Drawing.PointF]::new(38,49)))
- $g.FillPolygon((Brush '#50f4ff' 105), @([System.Drawing.PointF]::new(84,26),[System.Drawing.PointF]::new(54,9),[System.Drawing.PointF]::new(54,49)))
- $g.FillEllipse((Brush '#7a33c8'), 27, 18, 38, 42)
- $g.FillEllipse((Brush '#ff65bd'), 39, 25, 15, 16)
- $g.DrawEllipse((PenC '#dffcff' 2 180), 27, 18, 38, 42)
- }
- Save-Png 'enemy_turret' 96 76 {
- param($g,$w,$h)
- $g.Clear([System.Drawing.Color]::Transparent)
- $g.FillRectangle((Brush '#243e51'), 18, 33, 58, 28)
- $g.FillPie((Brush '#3f6473'), 24, 10, 48, 48, 180, 180)
- $g.FillRectangle((Brush '#92fbff'), 8, 28, 44, 10)
- $g.FillRectangle((Brush '#ffcc4d'), 2, 29, 9, 8)
- $g.DrawRectangle((PenC '#73f6ff' 3 170), 18, 33, 58, 28)
- }
- Save-Png 'boss_star_hive' 240 240 {
- param($g,$w,$h)
- $g.Clear([System.Drawing.Color]::Transparent)
- $g.FillEllipse((Brush '#34f1ff' 45), 18, 14, 204, 204)
- $g.FillEllipse((Brush '#3a1c64'), 43, 38, 154, 155)
- $g.FillEllipse((Brush '#ff4fae'), 74, 62, 92, 88)
- $g.FillEllipse((Brush '#f9ff90'), 102, 91, 34, 32)
- $g.DrawEllipse((PenC '#75faff' 6 190), 43, 38, 154, 155)
- for ($i=0; $i -lt 8; $i++) {
- $a = $i * [Math]::PI / 4
- $cx = 120 + [Math]::Cos($a) * 95
- $cy = 116 + [Math]::Sin($a) * 92
- $g.FillEllipse((Brush '#8c42e6'), [float]($cx-15), [float]($cy-15), 30, 30)
- $g.DrawLine((PenC '#ff86d0' 5 170), 120, 116, [float]$cx, [float]$cy)
- }
- $g.FillPolygon((Brush '#14182b'), @(
- [System.Drawing.PointF]::new(90,132),
- [System.Drawing.PointF]::new(120,154),
- [System.Drawing.PointF]::new(151,132),
- [System.Drawing.PointF]::new(120,142)
- ))
- }
- Save-Png 'alien_crystal' 72 90 {
- param($g,$w,$h)
- $g.Clear([System.Drawing.Color]::Transparent)
- $g.FillPolygon((Brush '#53f3ff' 135), @(
- [System.Drawing.PointF]::new(36,2),
- [System.Drawing.PointF]::new(65,38),
- [System.Drawing.PointF]::new(47,86),
- [System.Drawing.PointF]::new(16,86),
- [System.Drawing.PointF]::new(7,39)
- ))
- $g.FillPolygon((Brush '#ff4ec0' 100), @([System.Drawing.PointF]::new(36,2),[System.Drawing.PointF]::new(47,86),[System.Drawing.PointF]::new(31,72)))
- $g.DrawPolygon((PenC '#dffcff' 3 160), @(
- [System.Drawing.PointF]::new(36,2),
- [System.Drawing.PointF]::new(65,38),
- [System.Drawing.PointF]::new(47,86),
- [System.Drawing.PointF]::new(16,86),
- [System.Drawing.PointF]::new(7,39)
- ))
- }
- Save-Png 'bullet_rifle' 36 20 {
- param($g,$w,$h)
- $g.Clear([System.Drawing.Color]::Transparent)
- $g.FillEllipse((Brush '#fff39a'), 2, 6, 28, 8)
- $g.FillEllipse((Brush '#ffb84d'), 22, 5, 10, 10)
- }
- Save-Png 'bullet_flame' 48 28 {
- param($g,$w,$h)
- $g.Clear([System.Drawing.Color]::Transparent)
- $g.FillEllipse((Brush '#ff4c38' 190), 5, 4, 36, 20)
- $g.FillEllipse((Brush '#ffd45c' 220), 18, 8, 18, 12)
- }
- Save-Png 'bullet_rail' 96 24 {
- param($g,$w,$h)
- $g.Clear([System.Drawing.Color]::Transparent)
- $g.FillRectangle((Brush '#dfffff' 220), 4, 9, 82, 6)
- $g.FillEllipse((Brush '#68f7ff' 120), 0, 3, 92, 18)
- }
- Save-Png 'bullet_acid' 32 32 {
- param($g,$w,$h)
- $g.Clear([System.Drawing.Color]::Transparent)
- $g.FillEllipse((Brush '#bf5cff' 190), 5, 5, 22, 22)
- $g.FillEllipse((Brush '#ebff78' 210), 12, 9, 7, 7)
- }
- Save-Png 'ui_button' 96 84 {
- param($g,$w,$h)
- $g.Clear([System.Drawing.Color]::Transparent)
- $g.FillEllipse((Brush '#0b1726' 175), 4, 6, 88, 72)
- $g.DrawEllipse((PenC '#69f8ff' 3 180), 4, 6, 88, 72)
- $g.FillEllipse((Brush '#ff4fc3' 58), 18, 16, 58, 46)
- }
- Write-Host "Generated art assets in $out"
|