added second element type: snow
added simple snow weather
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
using FOU.Scripts;
|
||||
using FOU.Scripts.Elements;
|
||||
using Godot;
|
||||
|
||||
public partial class Main : Node2D {
|
||||
[Export] public int BrushSize = 5;
|
||||
[Export] public float TextureResolution = 0.5f;
|
||||
[Export] public float RainAmount = 0.01f;
|
||||
|
||||
private TextureRect mLevelDrawer;
|
||||
private Level mLevel;
|
||||
|
||||
public override void _Ready() {
|
||||
mLevel = new Level((int)(GetViewportRect().Size.X * TextureResolution),
|
||||
(int)(GetViewportRect().Size.Y * TextureResolution)
|
||||
(int)(GetViewportRect().Size.Y * TextureResolution), this
|
||||
);
|
||||
mLevelDrawer = GetNode<TextureRect>("CanvasLayer/LevelDrawer");
|
||||
}
|
||||
@@ -29,7 +31,7 @@ public partial class Main : Node2D {
|
||||
float mappedX = mouse.X / GetViewportRect().Size.X * mLevel.SizeX;
|
||||
float mappedY = mouse.Y / GetViewportRect().Size.Y * mLevel.SizeY;
|
||||
|
||||
mLevel.WritePixel((int)mappedX, (int)mappedY, BrushSize);
|
||||
mLevel.WritePixel<Dirt>((int)mappedX, (int)mappedY, BrushSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user