P3D-Legacy/P3D/Entites/Enviroment/StepBlock.vb

38 lines
1.2 KiB
VB.net
Raw Normal View History

2016-09-07 18:50:38 +02:00
Public Class StepBlock
Inherits Entity
Public Overrides Function WalkAgainstFunction() As Boolean
Dim facing As Integer = CInt(Me.Rotation.Y / MathHelper.PiOver2)
facing -= 2
If facing < 0 Then
facing += 4
End If
If Screen.Camera.GetPlayerFacingDirection() = facing Then
'Dim newPos As New Vector3(Screen.Camera.Position.X + Screen.Camera.moveDirectionX * 2, Screen.Camera.Position.Y, Screen.Camera.Position.Z + Screen.Camera.moveDirectionZ * 2)
'If CType(Screen.Camera, OverworldCamera).CheckCollision(newPos) = True Then
'End If
Screen.Camera.AddToPlannedMovement(New Vector3(0, 0.15F, 0))
Screen.Camera.Move(1.0F)
Screen.Level.OverworldPokemon.Visible = False
Screen.Level.OverworldPokemon.warped = True
SoundManager.PlaySound("jump_ledge", False)
Return False
End If
Return True
End Function
Public Overrides Sub Render()
If Me.Model Is Nothing Then
Me.Draw(Me.BaseModel, Textures, False)
Else
UpdateModel()
Draw(Me.BaseModel, Me.Textures, True, Me.Model)
End If
2016-09-07 18:50:38 +02:00
End Sub
End Class