问题描述
您好,我只是想确保您知道这是我正在进行的初学者项目。我没有使用XNA.Framework,DirectX,Unity或任何游戏引擎,我在VB.net中使用Windows窗体从头开始制作我自己的游戏,到目前为止它还好 - 但是:
问题1:当您在屏幕上移动时,窗体的背景图像上会出现一些小问题,。在图片中你可以看到玩家从墙上向下移动 - 但是墙壁稍微跟随了半秒钟。播放器是一个图片框,位于带有背景图像的表单之上。
问题2:有没有办法让图片框以45度角移动?不只是向下?我当前的玩家移动编码:
Hello, I just want to make sure you are aware this is a beginners project I am having. I am not using XNA.Framework, DirectX, Unity or any game engines, I am making my own game completely from scratch using windows forms in VB.net, so far its alright- however:
Question 1: When you move around the screen there is a little lagg on the backround image of the form, Screenshot. In the picture you can see the player moving downwards out of a wall- but the wall slightly follows for half a second. The player is a picturebox, on top of a form with a backround image.
Question 2: Is there a way to have the picturebox move at a 45 degree angle? Not just up an down? My current player movement coding:
Public Shared KeyboardKeysPressed As New HashSet(Of Keys)
Public Shared Sub OnFps(sender As Object, e As EventArgs) Handles Framerate.Tick
If KeyboardKeysPressed.Contains(Keys.W) Then
mainForm.Player_Picture.Top -= 8
ElseIf KeyboardKeysPressed.Contains(Keys.A) Then
mainForm.Player_Picture.Left -= 8
ElseIf KeyboardKeysPressed.Contains(Keys.D) Then
mainForm.Player_Picture.Left += 8
ElseIf KeyboardKeysPressed.Contains(Keys.S) Then
mainForm.Player_Picture.Top += 8
End If
End Sub
请注意我是初学者,所以我可能不会立即理解解决方案等。
提前谢谢!
Please note I am a beginner at this, so I might not understand a solution right away and such.
Thank you in advance!
推荐答案
这篇关于[VB.net]游戏,初学者项目:玩家运动问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!