Blocks of codes of STG# engine

This commit is contained in:
NitloadProgramming
2022-08-19 17:47:30 +08:00
parent af146be924
commit b38ebaae35
16 changed files with 300 additions and 0 deletions
Binary file not shown.
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
@@ -0,0 +1,42 @@
<?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>{5849875B-470A-43ED-AADF-539DED5F6CAD}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>Code01</RootNamespace>
<AssemblyName>Code01</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>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Compile Include="CodeFile1.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -0,0 +1,104 @@
/*
这是一段批处理一条子弹线上的子弹的位置数据
BulletChain Curve = *** ;
Bullet bulletToMove = Curve.First;
for(int i=0;BTM!=null,i++)
{
if(BTM.x<** || x>** || y<** || y>**)
{
Curve.Remove(i)
BTM = Curve.GetInsidence(i)
}
else
{
BTM.x += BTM.XMotion(Eclipse);
BTM.y += BTM.YMotion(Eclipse);
BTM = BTM.next;
}
*/
/*
这是一段子弹伪代码
Class Bullet
{
用于链表寻址
public Bullet Next{get;set;}
public Bullet Former{get;set;}
版面坐标
public float X{get; set;}
public float Y{get; set;}
表示XY速度的10*1十次多项式系数矩阵,
以及指向的方向,初始方向
public float[] VelovityX {get; set;}
public float[] VelocityY {get; set;}
public float[] Angle {get; set;}
public float AngleDefult {get; set;}
子弹种类和缩放比例,以确定贴图纹理及其大小
应当注意的是,缩放比例是指在子弹种类对应默认尺寸的基础上进行缩放
同时还有纹理相关数据
readonly Enum Type;
public float Size {get; set;}
public float[] DefultSize {get; set;}
public string TextureFile {get; set;}
public void GetAngle();
}
构造器,要求传入初始角度,子弹类型,缩放比例
public Bullet(float Angle, Enum type, float size)
{
this.AngleDefult = Angle;
this.Type=type;
this.SetType();
初始化速度,默认为0
this.VelocityX =
[ 0;...0; ]
this.VelovityY =
[ 0;...0; ]
}
根据子弹类型补充设置
private SetType()
{
int order = (int)Type
this.TextureFile = TextureList[order]
this.DefultSize[0] = DefultSizeList[order][0];
this.DefultSize[1] = DefultSizeList[order][1];
}
修改速度数据
public void SetVelocity(float[] xParaArray, float[] yParaArray)
{
this.VelocityX = xParaArray ;
this.VelocityY = yParaArray ;
}
使用秦九韶算法计算X轴位移
public float XMotion(Exlipse)
{
float xMotion = Eclipse;
for(int i=0; i<10; i++)
{
xMotion *= VelovityX[i];
xMotion += VelovityX[i+1];
}
return xMotion;
}
}
*/
@@ -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,30 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.2.32616.157
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CodeBlock", "CodeBlock", "{A4C61020-88DF-4729-B55C-7BB7B5DB7B2C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Code01", "Code01\Code01.csproj", "{5849875B-470A-43ED-AADF-539DED5F6CAD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5849875B-470A-43ED-AADF-539DED5F6CAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5849875B-470A-43ED-AADF-539DED5F6CAD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5849875B-470A-43ED-AADF-539DED5F6CAD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5849875B-470A-43ED-AADF-539DED5F6CAD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{5849875B-470A-43ED-AADF-539DED5F6CAD} = {A4C61020-88DF-4729-B55C-7BB7B5DB7B2C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4F721DF6-8FC7-4EB6-A3C2-46F566621FBA}
EndGlobalSection
EndGlobal
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
@@ -0,0 +1,53 @@
<?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>
@@ -0,0 +1,15 @@
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)
{
}
}
}
@@ -0,0 +1,36 @@
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")]
@@ -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")]