2025-05-13 19:22:01 +08:00

38 lines
774 B
C#

using System.Collections.Generic;
using System.ComponentModel;
using Godot;
using Godot.Bridge;
using Godot.NativeInterop;
[ScriptPath("res://Scripts/Bullets/AxisSphereSphere.cs")]
public partial class AxisSphereSphere : MoveAhead
{
public AxisSphere.Sphere data;
public void WallHit(Node other)
{
if (!other.HasMeta("Side"))
{
return;
}
if (!data.inside)
{
data.inside = true;
return;
}
Audio.PlaySound("snd_impact_ch1.wav", 1f, 1.1f);
switch ((DWMenu.BoardSides)(int)other.GetMeta("Side"))
{
case DWMenu.BoardSides.Up:
case DWMenu.BoardSides.Down:
speed = new Vector2(speed.X, 0f - speed.Y);
break;
case DWMenu.BoardSides.Left:
case DWMenu.BoardSides.Right:
speed = new Vector2(0f - speed.X, speed.Y);
break;
}
}
}