Simple shooting game (click on the targets)
Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
4 posts
Page 1 of 1
Hi all. I'm looking for tutorial to a game, like this: https://www.youtube.com/watch?v=JchYBOxNrAg
with using Pictureboxes (no DirectX).
Greetings.
I found this : http://www.youtube.com/watch?v=J0BlJuwA ... re=related, and that is that, but how to scroll a background?? Background will be form1 background image.
Scrolling, (this effect what i want) is shown in first link at 0:12
And how to do that the killed animal, is going up? Maybe some timer, and at ticks make picturebox postion up?
How to do label with score given (I mean this numbers up to the dead animal) position? Maybe picturebox postion x +1 or someting like this?
with using Pictureboxes (no DirectX).
Greetings.
I found this : http://www.youtube.com/watch?v=J0BlJuwA ... re=related, and that is that, but how to scroll a background?? Background will be form1 background image.
Scrolling, (this effect what i want) is shown in first link at 0:12
And how to do that the killed animal, is going up? Maybe some timer, and at ticks make picturebox postion up?
How to do label with score given (I mean this numbers up to the dead animal) position? Maybe picturebox postion x +1 or someting like this?
Cody can show you how, he made something like that once.
Practice makes perfect!
VIP since: 6-10-2011
VIP since: 6-10-2011
You are best off making the game within a usercontrol which is then placed onto the form and used to pan/move the background.
Example if you add a usercontrol to your project and add your background image to it then resize it to fit the background image then add a timer to it and the following code:
As for the floating numbers etc you could make that in another usercontrol with a timer added to make it "float" upwards.
Heres a really quick example project I made and you may need to install Visual Studio 2012 to open it :? Pictureboxes are good but for a game you are better off using GDI+ (paint events) so its nice and smooth.
Heres another old project of a game I made called BJungle which is a basic platform game and uses the paint events...code is messy lol.
Example if you add a usercontrol to your project and add your background image to it then resize it to fit the background image then add a timer to it and the following code:
Code: Select all
After adding the usercontrol to your main form and running the project you can use the arrow keys to move it left or right. Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Integer) As Integer
Private Sub Gamepanel_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
If CBool(GetAsyncKeyState(Keys.Left)) Then
If Me.Location.X < 0 Then
Me.Left += 5
End If
ElseIf CBool(GetAsyncKeyState(Keys.Right)) Then
If Me.Location.X + Me.Width > Parent.Width Then
Me.Left -= 5
End If
End If
End Sub
As for the floating numbers etc you could make that in another usercontrol with a timer added to make it "float" upwards.
Heres a really quick example project I made and you may need to install Visual Studio 2012 to open it :? Pictureboxes are good but for a game you are better off using GDI+ (paint events) so its nice and smooth.
Heres another old project of a game I made called BJungle which is a basic platform game and uses the paint events...code is messy lol.
You do not have the required permissions to view the files attached to this post.
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
If you're going to use a lot of pictureboxes, keep this in mind, VB.net transparency sucks. The flying birds won't be smooth at all. As Cody said, go with GDI+.
4 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023