daily update on 20221020

This commit is contained in:
Youmu Konpaku
2022-10-21 01:55:54 +08:00
parent ef34fcf3c1
commit 7dc8f402e1
48 changed files with 297 additions and 98 deletions
@@ -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;
}
}
}
@@ -65,113 +65,131 @@ namespace StgSharp_Entity
this._keyboardState = keyboardState;
}
private Launcher _launcherAtHigh;
public Launcher LauncherAtHigh
{
get { return LauncherAtHigh; }
set { LauncherAtHigh = value; }
}
private Launcher _launcherAtLow;
public void Action()
{
if (_keyboardState.IsAnyKeyDown)
if (_keyboardState.IsKeyDown(Key.ShiftLeft))
{
Move();
FastShoot();
FastMove();
}
}
/// <summary>
/// 自机移动的简单方法
/// 自机高速移动的简单方法
/// </summary>
public void Move()
public void SlowMove()
{
if (_keyboardState.IsKeyDown(Key.ShiftLeft))
{
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;
}
if (_keyboardState.IsKeyDown(Key.Up))
{
if (_keyboardState.IsKeyDown(Key.Left))
{
this._yLocation += _vLowCorner;
this._xLocation -= _vLowCorner;
}
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;
}
else if (_keyboardState.IsKeyDown(Key.Right))
{
this._yLocation += _vLowCorner;
this._xLocation += _vLowCorner;
}
else
{
this._yLocation += _velocityLow;
}
}
else
{
if (_keyboardState.IsKeyDown(Key.Up))
else if (_keyboardState.IsKeyDown(Key.Down))
{
if (_keyboardState.IsKeyDown(Key.Left))
{
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;
}
this._yLocation -= _vLowCorner;
this._xLocation -= _vLowCorner;
}
else if (_keyboardState.IsKeyDown(Key.Down))
else if (_keyboardState.IsKeyDown(Key.Right))
{
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;
}
this._yLocation -= _vLowCorner;
this._xLocation += _vLowCorner;
}
else
{
this._yLocation -= _velocityLow;
}
}
}
public void UseSkill(KeyboardState key)
/// <summary>
/// 自机低速移动的简单方法
/// </summary>
public void FastMove()
{
if (key.IsKeyDown(Key.X))
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 LaunchBullet(KeyboardState key)
public void SlowSoot()
{
}
if (_keyboardState.IsKeyDown(Key.Z))
{
}
}
public void Die()
{
@@ -21,6 +21,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -45,6 +46,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Bullet.cs" />
<Compile Include="Launcher.cs" />
<Compile Include="Player.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
@@ -1 +1 @@
2d5905d44084acf7b24064935643d53ef7c88707
0fdc9e02df8123646ab2059355451462f25ad255