Hey guys
I am having a weird camera issue. Whenever I'm creating a new object inside the game loop (like an arrow) the entire camera resets! I have no idea how to solve it and I could not find the problem in my code. Today I made an simple and short test project to see how to recreate the problem. Here is the code:
Imports DarkGDK
Imports DarkGDK.Animation
Imports DarkGDK.Audio
Imports DarkGDK.Basic2D
Imports DarkGDK.Basic3D
Imports DarkGDK.Camera
Imports DarkGDK.IO
Imports DarkGDK.Lighting
Imports DarkGDK.Math
Imports DarkGDK.Net
Imports DarkGDK.Particle
Imports DarkGDK.World
Module Test
Dim Crates As New List(Of Crate)
Dim newcrate As Boolean = False
Public Sub Main()
Engine.InitializeGDK()
For a = 0 To 5
Crates.Add(New Crate(Core.Random(1000), 0, Core.Random(1000)))
Next
While Engine.LoopGDK
For Each c In Crates
c.Sync()
Next
If Keyboard.State(Keys.Space) And newcrate = False Then
newcrate = True
'Crates.Add(New Crate(Core.Random(1000), 0, Core.Random(1000)))
Dim c As New Crate(Core.Random(1000), 0, Core.Random(1000))
End If
If Keyboard.State(Keys.Space) = False Then
newcrate = False
End If
DefaultCamera.ControlDefaultUsingArrowKeys(2, 4)
Core.Sync()
End While
End Sub
End Module
//Crate.vb\\
Imports DarkGDK
Imports DarkGDK.Animation
Imports DarkGDK.Audio
Imports DarkGDK.Basic2D
Imports DarkGDK.Basic3D
Imports DarkGDK.Camera
Imports DarkGDK.IO
Imports DarkGDK.Lighting
Imports DarkGDK.Math
Imports DarkGDK.Net
Imports DarkGDK.Particle
Imports DarkGDK.World
Public Class Crate
Inherits Cube
Public Sub Sync()
YRotate(AngleY + 1)
End Sub
Public Sub New(ByVal x As Single, ByVal y As Single, ByVal z As Single)
MyBase.New(100)
Position(x, y, z)
End Sub
End Class
In case you can provide me with a workaround: My purpose was to let an enemy shoot arrows. That's it.
Nothing to tell, really.