Better Algorithm for Bullet's constructor
This commit is contained in:
BIN
Binary file not shown.
Binary file not shown.
@@ -36,47 +36,60 @@ public Bullet Former{get;set;}
|
|||||||
public float X{get; set;}
|
public float X{get; set;}
|
||||||
public float Y{get; set;}
|
public float Y{get; set;}
|
||||||
|
|
||||||
表示XY速度的10*1十次多项式系数矩阵,
|
表示XY线性速度的10*1十次多项式系数矩阵
|
||||||
|
表示XY周期性速度数据的三阶傅里叶变换式
|
||||||
以及指向的方向,初始方向
|
以及指向的方向,初始方向
|
||||||
public float[] VelovityX {get; set;}
|
public float[] VelovityX {get; set;}
|
||||||
public float[] VelocityY {get; set;}
|
public float[] VelocityY {get; set;}
|
||||||
|
public float[] FourierX {get; set;}
|
||||||
|
public float[] FourierY {get; set;}
|
||||||
public float[] Angle {get; set;}
|
public float[] Angle {get; set;}
|
||||||
public float AngleDefult {get; set;}
|
public float AngleDefult {get; set;}
|
||||||
|
|
||||||
子弹种类和缩放比例,以确定贴图纹理及其大小
|
子弹种类和缩放比例,以确定贴图纹理及其大小
|
||||||
应当注意的是,缩放比例是指在子弹种类对应默认尺寸的基础上进行缩放
|
同时还有纹理相关数据,碰撞半径
|
||||||
同时还有纹理相关数据
|
|
||||||
readonly Enum Type;
|
readonly Enum Type;
|
||||||
public float Size {get; set;}
|
public float[] Size {get; set;}
|
||||||
public float[] DefultSize {get; set;}
|
|
||||||
public string TextureFile {get; set;}
|
public string TextureFile {get; set;}
|
||||||
|
public void Float StrikeRadias {get; det;}
|
||||||
|
|
||||||
public void GetAngle();
|
public void GetAngle();
|
||||||
}
|
}
|
||||||
|
|
||||||
构造器,要求传入初始角度,子弹类型,缩放比例
|
构造器,要求传入初始角度,子弹类型,缩放比例
|
||||||
|
应当注意的是,size变量指子弹的缩放比例
|
||||||
|
缩放比例是指在子弹种类对应默认尺寸的基础上进行缩放
|
||||||
public Bullet(float Angle, Enum type, float size)
|
public Bullet(float Angle, Enum type, float size)
|
||||||
{
|
{
|
||||||
this.AngleDefult = Angle;
|
this.AngleDefult = Angle;
|
||||||
|
|
||||||
this.Type=type;
|
this.Type=type;
|
||||||
this.SetType();
|
this.StrikeRadias = 0.0f;
|
||||||
|
this.SetType(float size);
|
||||||
|
|
||||||
初始化速度,默认为0
|
初始化速度,默认为0
|
||||||
this.VelocityX =
|
this.VelocityX =
|
||||||
[ 0;...0; ]
|
[ 0.0f ; ... 0.0f ; ]
|
||||||
this.VelovityY =
|
this.VelovityY =
|
||||||
[ 0;...0; ]
|
[ 0.0f ; ... 0.0f; ]
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
根据子弹类型补充设置
|
根据子弹类型补充设置
|
||||||
private SetType()
|
private SetType(float size)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
将默认数据作为当前数据
|
||||||
int order = (int)Type
|
int order = (int)Type
|
||||||
this.TextureFile = TextureList[order]
|
this.TextureFile = TextureList[order]
|
||||||
this.DefultSize[0] = DefultSizeList[order][0];
|
this.Size[0] = DefultSizeList[order][0];
|
||||||
this.DefultSize[1] = DefultSizeList[order][1];
|
this.Size[1] = DefultSizeList[order][1];
|
||||||
|
|
||||||
|
将缩放比例设置添加至当前参数设置
|
||||||
|
this.StrikeRadias = DefultRadiasList[order] * size;
|
||||||
|
this.Size[0] *= size;
|
||||||
|
this.Size[1] *= size;
|
||||||
}
|
}
|
||||||
|
|
||||||
修改速度数据
|
修改速度数据
|
||||||
@@ -96,6 +109,7 @@ xMotion *= VelovityX[i];
|
|||||||
xMotion += VelovityX[i+1];
|
xMotion += VelovityX[i+1];
|
||||||
}
|
}
|
||||||
xMotion *= Eclipse;
|
xMotion *= Eclipse;
|
||||||
|
|
||||||
return xMotion;
|
return xMotion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<configuration>
|
|
||||||
<startup>
|
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
|
||||||
</startup>
|
|
||||||
</configuration>
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
<?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>{909E6030-B105-40D9-A94A-3621903929E4}</ProjectGuid>
|
|
||||||
<OutputType>Exe</OutputType>
|
|
||||||
<RootNamespace>CodeBlock</RootNamespace>
|
|
||||||
<AssemblyName>CodeBlock</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
|
||||||
<Deterministic>true</Deterministic>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<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="Program.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="App.config" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
|
||||||
</Project>
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CodeBlock
|
|
||||||
{
|
|
||||||
internal class Program
|
|
||||||
{
|
|
||||||
static void Main(string[] args)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
using System.Reflection;
|
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
// 有关程序集的一般信息由以下
|
|
||||||
// 控制。更改这些特性值可修改
|
|
||||||
// 与程序集关联的信息。
|
|
||||||
[assembly: AssemblyTitle("CodeBlock")]
|
|
||||||
[assembly: AssemblyDescription("")]
|
|
||||||
[assembly: AssemblyConfiguration("")]
|
|
||||||
[assembly: AssemblyCompany("")]
|
|
||||||
[assembly: AssemblyProduct("CodeBlock")]
|
|
||||||
[assembly: AssemblyCopyright("Copyright © 2022")]
|
|
||||||
[assembly: AssemblyTrademark("")]
|
|
||||||
[assembly: AssemblyCulture("")]
|
|
||||||
|
|
||||||
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
|
||||||
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
|
|
||||||
//请将此类型的 ComVisible 特性设置为 true。
|
|
||||||
[assembly: ComVisible(false)]
|
|
||||||
|
|
||||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
|
||||||
[assembly: Guid("909e6030-b105-40d9-a94a-3621903929e4")]
|
|
||||||
|
|
||||||
// 程序集的版本信息由下列四个值组成:
|
|
||||||
//
|
|
||||||
// 主版本
|
|
||||||
// 次版本
|
|
||||||
// 生成号
|
|
||||||
// 修订号
|
|
||||||
//
|
|
||||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
|
||||||
//通过使用 "*",如下所示:
|
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
|
||||||
[assembly: AssemblyVersion("1.0.0.0")]
|
|
||||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
||||||
-4
@@ -1,4 +0,0 @@
|
|||||||
// <autogenerated />
|
|
||||||
using System;
|
|
||||||
using System.Reflection;
|
|
||||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
|
|
||||||
Binary file not shown.
BIN
Binary file not shown.
Reference in New Issue
Block a user