daily update on 20230301 by nitload youmu, file struct cahnged and more vec func added

This commit is contained in:
Nitload
2023-03-02 01:30:46 +08:00
parent d09105c9c1
commit bb71567e51
594 changed files with 368 additions and 2601 deletions
@@ -0,0 +1,172 @@
using StgSharp_Logic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp_Entity
{
public unsafe class Bullet:LinkedTarget
{
//子弹的缩放比例
private float _size;
public float Size
{
get { return _size; }
set {
if (value > 0)
{
_size = value;
this.Radius = DefualtRadius * Size;
}
else
{
throw new ArgumentException("Size cannot be smaller than zero!");
}
}
}
//该种类子弹的默认大小
private static float _defualtRadius;
public static float DefualtRadius
{
get { return _defualtRadius; }
set { _defualtRadius = value; }
}
//子弹的实际判定半径
private float _radius;
public float Radius
{
get { return _radius; }
set { _radius = value; }
}
//子弹x轴运动的函数表达
private float[] _xVelocity;
public float[] XVelocity
{
get { return _xVelocity; }
set {
if (value.Length==10)
{
_xVelocity = value;
}
else
{
throw new ArgumentException("Too many or too few parameters!");
}
}
}
//子弹y轴运动的函数表达
private float[] _yVelocity;
public float[] YVelocity
{
get { return _yVelocity; }
set
{
if (value.Length == 10)
{
_yVelocity = value;
}
else
{
throw new ArgumentException("Too many or too few parameters!");
}
}
}
private float* _x;
//xy坐标
public float* X
{
get { return _x; }
set { _x = value; }
}
private float* _y;
public float* Y
{
get { return _y; }
set { _y = value; }
}
private uint _beginTick;
public uint BeginTick
{
get { return _beginTick; }
set { _beginTick = value; }
}
public Bullet()
{
}
//通过传入的时间刻计算位移并更新位置坐标
public void move(uint tick)
{
float deltaTick = tick - _beginTick;
float deltaX = 0;
for (int i = 0; i < 10; i++)
{
deltaX += _xVelocity[i];
deltaX *= deltaTick;
}
deltaX += _xVelocity[10];
*_x += deltaX;
float deltaY = 0;
for (int i = 0; i < 10; i++)
{
deltaY += _yVelocity[i];
deltaY *= deltaTick;
}
deltaY += _yVelocity[10];
*_y += deltaY;
}
/// <summary>
/// 修改自身路径,修改条件由外部逻辑判断触发
/// </summary>
public void ChangeVelocity(float[] XSpeed,float[] YSpeed)
{
if (XSpeed != null)
{
if (XSpeed.Length == 10)
{
this._xVelocity = XSpeed;
}
else
{
throw new Exception("The amount of parameters should be 10!");
}
}
if (YSpeed != null)
{
if (YSpeed.Length == 10)
{
this._yVelocity = YSpeed;
}
else
{
throw new Exception("The amount of parameters should be 10!");
}
}
}
}
}
@@ -0,0 +1,51 @@
using OpenTK;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp_Entity
{
internal unsafe class Launcher
{
private Bullet _bullet;
public Bullet NewBullet
{
get { return _bullet; }
set { _bullet = value; }
}
private float* _xPositon;
public float* XPsition
{
get { return _xPositon; }
set { _xPositon = value; }
}
private float* _yPosition;
public float* YPosition
{
get { return _yPosition; }
set { _yPosition = value; }
}
public Launcher()
{
}
public void Bind(float* _xPointer,float* _yPointer)
{
_xPositon = _xPointer;
_yPosition = _yPointer;
}
}
}
@@ -0,0 +1,25 @@
<configuration>
<dllmap os="linux" dll="opengl32.dll" target="libGL.so.1"/>
<dllmap os="linux" dll="glu32.dll" target="libGLU.so.1"/>
<dllmap os="linux" dll="openal32.dll" target="libopenal.so.1"/>
<dllmap os="linux" dll="alut.dll" target="libalut.so.0"/>
<dllmap os="linux" dll="opencl.dll" target="libOpenCL.so"/>
<dllmap os="linux" dll="libX11" target="libX11.so.6"/>
<dllmap os="linux" dll="libXi" target="libXi.so.6"/>
<dllmap os="linux" dll="SDL2.dll" target="libSDL2-2.0.so.0"/>
<dllmap os="osx" dll="opengl32.dll" target="/System/Library/Frameworks/OpenGL.framework/OpenGL"/>
<dllmap os="osx" dll="openal32.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
<dllmap os="osx" dll="alut.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
<dllmap os="osx" dll="libGLES.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="libGLESv1_CM.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="libGLESv2.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="opencl.dll" target="/System/Library/Frameworks/OpenCL.framework/OpenCL"/>
<dllmap os="osx" dll="SDL2.dll" target="libSDL2.dylib"/>
<!-- XQuartz compatibility (X11 on Mac) -->
<dllmap os="osx" dll="libGL.so.1" target="/usr/X11/lib/libGL.dylib"/>
<dllmap os="osx" dll="libX11" target="/usr/X11/lib/libX11.dylib"/>
<dllmap os="osx" dll="libXcursor.so.1" target="/usr/X11/lib/libXcursor.dylib"/>
<dllmap os="osx" dll="libXi" target="/usr/X11/lib/libXi.dylib"/>
<dllmap os="osx" dll="libXinerama" target="/usr/X11/lib/libXinerama.dylib"/>
<dllmap os="osx" dll="libXrandr.so.2" target="/usr/X11/lib/libXrandr.dylib"/>
</configuration>
@@ -0,0 +1,199 @@
using OpenTK;
using OpenTK.Input;
using StgSharp_Entity;
using StgSharp_Logic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp_Entity
{
internal class Player:LinkedTarget
{
private uint gameTick;
private uint beginTick;
private readonly float _velocityHigh;
private readonly float _vHighCorner;
public float VelocityHigh
{
get { return _velocityHigh; }
}
private readonly float _velocityLow;
private readonly float _vLowCorner;
public float VelocityLow
{
get { return _velocityLow; }
}
private float _xLocation;
public float XLocation
{
get { return _xLocation; }
set { _xLocation = value; }
}
public float _yLocation;
public float YLocation
{
get { return _yLocation; }
set { _yLocation = value; }
}
private KeyboardState _keyboardState;
public KeyboardState KeyboardState
{
get { return _keyboardState; }
set { _keyboardState = value; }
}
public Player(float velocityHigh,float velocityLow,KeyboardState keyboardState)
{
this._velocityHigh = velocityHigh;
this._vHighCorner = velocityHigh / 1.4142136f;
this._velocityLow = velocityLow;
this._vLowCorner = velocityLow / 1.4142136f;
this._keyboardState = keyboardState;
}
private Launcher _launcherAtHigh;
public Launcher LauncherAtHigh
{
get { return LauncherAtHigh; }
set { LauncherAtHigh = value; }
}
private Launcher _launcherAtLow;
public void Action()
{
if (_keyboardState.IsKeyDown(Key.ShiftLeft))
{
FastShoot();
FastMove();
}
}
/// <summary>
/// 自机高速移动的简单方法
/// </summary>
public void SlowMove()
{
if (_keyboardState.IsKeyDown(Key.Up))
{
if (_keyboardState.IsKeyDown(Key.Left))
{
this._yLocation += _vLowCorner;
this._xLocation -= _vLowCorner;
}
else if (_keyboardState.IsKeyDown(Key.Right))
{
this._yLocation += _vLowCorner;
this._xLocation += _vLowCorner;
}
else
{
this._yLocation += _velocityLow;
}
}
else if (_keyboardState.IsKeyDown(Key.Down))
{
if (_keyboardState.IsKeyDown(Key.Left))
{
this._yLocation -= _vLowCorner;
this._xLocation -= _vLowCorner;
}
else if (_keyboardState.IsKeyDown(Key.Right))
{
this._yLocation -= _vLowCorner;
this._xLocation += _vLowCorner;
}
else
{
this._yLocation -= _velocityLow;
}
}
}
/// <summary>
/// 自机低速移动的简单方法
/// </summary>
public void FastMove()
{
if (_keyboardState.IsKeyDown(Key.Up))
{
if (_keyboardState.IsKeyDown(Key.Left))
{
this._yLocation += _vHighCorner;
this._xLocation -= _vHighCorner;
}
else if (_keyboardState.IsKeyDown(Key.Right))
{
this._yLocation += _vHighCorner;
this._xLocation += _vHighCorner;
}
else
{
this._yLocation += _velocityHigh;
}
}
else if (_keyboardState.IsKeyDown(Key.Down))
{
if (_keyboardState.IsKeyDown(Key.Left))
{
this._yLocation -= _vHighCorner;
this._xLocation -= _vHighCorner;
}
else if (_keyboardState.IsKeyDown(Key.Right))
{
this._yLocation -= _vHighCorner;
this._xLocation += _vHighCorner;
}
else
{
this._yLocation -= _velocityHigh;
}
}
}
public void UseSkill()
{
if (_keyboardState.IsKeyDown(Key.X))
{
//new event added to use spell
}
}
public void FastShoot()
{
if (_keyboardState.IsKeyDown(Key.Z))
{
}
}
public void SlowSoot()
{
if (_keyboardState.IsKeyDown(Key.Z))
{
}
}
public void Die()
{
}
}
}
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("StgSharp_Entity")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("StgSharp_Entity")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("a7275572-a4e7-4863-b326-f09bfa241334")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{A7275572-A4E7-4863-B326-F09BFA241334}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>StgSharp_Entity</RootNamespace>
<AssemblyName>StgSharp_Entity</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="OpenTK, Version=3.3.3.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<HintPath>..\packages\OpenTK.3.3.3\lib\net20\OpenTK.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Bullet.cs" />
<Compile Include="Launcher.cs" />
<Compile Include="Player.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="OpenTK.dll.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\StgSharp_Logic\StgSharp_Logic.csproj">
<Project>{ae7f3290-9ab4-4b54-aab1-4ddcba20f89d}</Project>
<Name>StgSharp_Logic</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
@@ -0,0 +1 @@
0fdc9e02df8123646ab2059355451462f25ad255
@@ -0,0 +1,12 @@
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\STGSharp\StgSharp_Entity\bin\Debug\StgSharp_Entity.dll
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\STGSharp\StgSharp_Entity\bin\Debug\StgSharp_Entity.pdb
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\STGSharp\StgSharp_Entity\bin\Debug\OpenTK.dll
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\STGSharp\StgSharp_Entity\bin\Debug\StgSharp_Logic.dll
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\STGSharp\StgSharp_Entity\bin\Debug\StgSharp_Logic.pdb
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\STGSharp\StgSharp_Entity\bin\Debug\OpenTK.pdb
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\STGSharp\StgSharp_Entity\bin\Debug\OpenTK.xml
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\STGSharp\StgSharp_Entity\obj\Debug\StgSharp_Entity.csproj.AssemblyReference.cache
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\STGSharp\StgSharp_Entity\obj\Debug\StgSharp_Entity.csproj.CoreCompileInputs.cache
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\STGSharp\StgSharp_Entity\obj\Debug\StgSharp_Entity.csproj.CopyComplete
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\STGSharp\StgSharp_Entity\obj\Debug\StgSharp_Entity.dll
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\.Net Framework\STGSharp\StgSharp_Entity\obj\Debug\StgSharp_Entity.pdb
@@ -0,0 +1 @@
obj\Debug\\_IsIncrementalBuild
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="OpenTK" version="3.3.3" targetFramework="net472" />
</packages>