Okay, heres my code. What I"m trying to do is just get the image to move around the screen with the arrow keys...
I"m using Visual Basic.net 2003 FYI
Option Explicit On
Imports DaBoodaTurbo2DEngine
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
InitializeComponent()
End Sub
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
Private components As System.ComponentModel.IContainer
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(1016, 752)
Me.Name = "Form1"
Me.Text = "Form1"
End Sub
#End Region
Dim Engine As New DBTurbo2DEngine
Dim BLooping As Boolean
Dim Angle As Single
Dim sSize As Single
Dim imgX As Integer = 400
Dim imgY As Integer = 300
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Show()
System.Windows.Forms.Application.DoEvents()
Engine = New DBTurbo2DEngine
Engine.InitializeDisplay(Me.Handle.ToInt32, True, 800, 600, 0, 1)
Engine.SetUpMapView(0, 0, 800, 600, 0)
Engine.DBFPS.SetFrameRate(60)
Engine.SetMaxLevel(1)
With Engine
.SetBackColorBlue(0)
.SetBackColorGreen(0)
.SetBackColorRed(0)
End With
With Engine.DBTexture
.SetFolder("c:\")
.Add(256, "Ball", , 2)
End With
With Engine.DBOverlay
.Add()
.SetTextureReference(1, 1)
.SetVisible(1, True)
.QMSetGetRectangle(1, 0, 0, 256, 256)
.QMSetPutRectangle(1, -123, -123, 256, 256)
.SetXPosition(1, 400)
.SetYPosition(1, 300)
.ULSetColor(1, 255, 0, 0)
.URSetColor(1, 0, 255, 0)
.LLSetColor(1, 255, 255, 255)
.LRSetColor(1, 0, 0, 255)
End With
With Engine.DBText
.CreateFont("timenewroman", 16)
.Add()
.SetVisible(1, True)
.SetText(1, "FPS - ")
.QMSetPutRectangle(1, 0, 0, 100, 30)
End With
With Engine.DBKeyInput
.Initialize(Me.Handle.ToInt32)
.Add(DxVBLibA.CONST_DIKEYFLAGS.DIK_UP)
.Add(DxVBLibA.CONST_DIKEYFLAGS.DIK_DOWN)
.Add(DxVBLibA.CONST_DIKEYFLAGS.DIK_LEFT)
.Add(DxVBLibA.CONST_DIKEYFLAGS.DIK_RIGHT)
.Add(DxVBLibA.CONST_DIKEYFLAGS.DIK_ESCAPE)
.SetAutoFire(1, True)
.SetAutoFire(2, True)
.SetAutoFire(3, True)
.SetAutoFire(4, True)
End With
Angle = 0 : sSize = 128 : BLooping = True
Do While BLooping = True
With Engine
If .DBKeyInput.ReturnKeyDown(1) = True Then
imgX = imgX - 5
Engine.DBMath.SpriteAngleIncrementUp(1, 5)
End If
If .DBKeyInput.ReturnKeyDown(2) = True And sSize <> 2 Then
imgX = imgX - 5
Engine.DBMath.SpriteAngleIncrementDown(1, 5)
End If
If .DBKeyInput.ReturnKeyDown(3) = True Then
imgY = imgY - 5
Engine.DBMath.SpriteAngleIncrementLeft(1, 5)
End If
If .DBKeyInput.ReturnKeyDown(4) = True Then
imgY = imgY + 5
Engine.DBMath.SpriteAngleIncrementRight(1, 5)
End If
If .DBKeyInput.ReturnKeyDown(5) = True Then
BLooping = False
End If
End With
Engine.DBText.SetText(1, "FPS - " & Format(Engine.DBFPS.GetFPS, "000"))
Engine.Render()
Loop
End Sub
Private Sub Form_Unload(ByVal Cancel As Integer)
If BLooping = True Then
Cancel = 1 Engine = Nothing
BLooping = False End If
End Sub
End Class