Um mich ein bisschen in XNA und Visual Basic umzuschauen hab ich versucht das Platform Game - Beispiel von C# XNA Game Studio zu übersetzen (gibt im inet en übersetzer, is recht leicht weil ja beide codes in einen gleichen zwischencode übersetzt werden beim compilieren)
so, nun hab ich alle klasen übersetzt und hinzugefügt, zeigt auch keine fehler an außer bei einer Zeile:
Code:
Imports System Imports Microsoft.Xna.Framework Imports Microsoft.Xna.Framework.Graphics Namespace Platformer1 ''' <summary> ''' Controls playback of an Animation. ''' </summary> Structure AnimationPlayer ''' <summary> ''' Gets the animation which is currently playing. ''' </summary> Public ReadOnly Property Animation() As Animation Get Return m_animation End Get End Property Private m_animation As Animation ''' <summary> ''' Gets the index of the current frame in the animation. ''' </summary> Public ReadOnly Property FrameIndex() As Integer Get Return m_frameIndex End Get End Property Private m_frameIndex As Integer ''' <summary> ''' The amount of time in seconds that the current frame has been shown for. ''' </summary> Private time As Single ''' <summary> ''' Gets a texture origin at the bottom center of each frame. ''' </summary> Public ReadOnly Property Origin() As Vector2 Get Return New Vector2(Animation.FrameWidth / 2.0F, Animation.FrameHeight) End Get End Property ''' <summary> ''' Begins or continues playback of an animation. ''' </summary> Public Sub PlayAnimation(ByVal animation__1 As Animation) ' If this animation is already running, do not restart it. If [COLOR="Red"]animation__1 = animation[/COLOR] Then Exit Sub End If ' Start the new animation. Me.m_animation = animation__1 Me.m_frameIndex = 0 Me.time = 0.0F End Sub ''' <summary> ''' Advances the time position and draws the current frame of the animation. ''' </summary> Public Sub Draw(ByVal gameTime As GameTime, ByVal spriteBatch As SpriteBatch, ByVal position As Vector2, ByVal spriteEffects As SpriteEffects) If Animation Is Nothing Then Throw New NotSupportedException("No animation is currently playing.") End If ' Process passing time. time += CSng(gameTime.ElapsedGameTime.TotalSeconds) While time > Animation.FrameTime time -= Animation.FrameTime ' Advance the frame index; looping or clamping as appropriate. If Animation.IsLooping Then m_frameIndex = (m_frameIndex + 1) Mod Animation.FrameCount Else m_frameIndex = Math.Min(m_frameIndex + 1, Animation.FrameCount - 1) End If End While ' Calculate the source rectangle of the current frame. Dim source As New Rectangle(FrameIndex * Animation.Texture.Height, 0, Animation.Texture.Height, Animation.Texture.Height) ' Draw the current frame. spriteBatch.Draw(Animation.Texture, position, source, Color.White, 0.0F, Origin, _ 1.0F, spriteEffects, 0.0F) End Sub End Structure End Namespace
Der =-Operator ist für die Typen "Spiel1.Platformer1.Animation" und "Spiel1.Platformer1.Animation" nicht definiert.
Animation is ne Klasse..
hat jemand ne idee an was es liegen könnte?
ich will eig nur das der code funktioniert um ihn dann genauer anzuschauen :o