Visual Basic Express 2010 Tutorial 34 Programming The Shooter - EZInvaders Part 3 Game

preview_player
Показать описание
This tutorial will move the shooter with the arrow keys. KeyDown will be used. KeyDown is a little different than KeyPress. Also, KeyUp will be used. Some hit detection will be used to check to see if the shooter has hit the edge of the form. The hit detection will prevent the shooter from leaving the form
Рекомендации по теме
Комментарии
Автор

@IverfixVideos The code is on the schoolfreeware website in the VB tutorial section. You can compare that code with what you have

SchoolFreeware
Автор

thank you so much for this video, i finnaly realise my mistake in syntax

NeutronHex
Автор

@GWODClan .h is used in C++. Double check to see if you were working in Visual C++ instead of Visual Basic

SchoolFreeware
Автор

@legobobsleder C# should be able to do this, however, I have not tried it. The language syntax must be changed from VB to C# for it to work.

SchoolFreeware
Автор

if shooter is not moving try this
code in timer:
PictureBox.left -= 2
(you will need two timers in the other put += instead of -= )

troyankleshanker
Автор

@ChaseandDonny Is the timer enabled? - The code can be downloaded at the SchoolFreeware website, so, you can compare what you have to the code in the tutorial series.

- Have A Great Day

SchoolFreeware
Автор

@SuperVideopeeps check to see if the timer is enabled

SchoolFreeware
Автор

Thanks, this really helps!! I am working on my own game and using this as a starter. Of course I am not copying your game! this is a great substitute to making a flash game, which I would have to pay $700.00 for! :D Thanks again!

AwesomeAnimatorMan
Автор

You explain things very clearly with voice and video, I had to subscribe lol thank you

billrock
Автор

You must use Shooter.Left to move the player because Shooter.Right is read-only. To move it to the right do something like: Shooter.Left += ShooterSpeed. But, I guess you learned this a long time ago since you commented like 10 months ago.

IvanVinski
Автор

Is the timer enabled?

In the timer properties set enabled = true.

SchoolFreeware
Автор

I took a look at your code. The timer must be enabled and add the line MoveShooter to TimerMain_Tick. When the timer ticks the sub MoveShooter will be called allowing the shooter to move.

Hope this works

SchoolFreeware
Автор

works well with select case and no need for all thoses if' statements

unholydragon
Автор

On the "key up" you can just put.
SLeft = false
SRight = False

carsonsmith
Автор

why did you use a timer to move the shooter you could put the code behind picture box

under keydown on the picture box- e.keycode right = true then picturebox1.left = picturebox1.left + 10

Автор

@mindystorm change the name of the shooter's picturebox to shooter

SchoolFreeware
Автор

When trying to stop the shooter leaving the client rectangle it comes with the error "Operator '<' is not defined for types 'Integer' and 'System.Drawing.Rectangle'." why is this?


JimbowPA
Автор

its saying Error Operator '-' is not defined for types 'Integer' and '1-dimensional array of Integer".

Chasencolinful
Автор

could you have the variable type as string instead of boolean, or would it not be enough?

Thehalopianoplayer
Автор

@ChaseandDonny Change the name of the PictureBox to Shooter

SchoolFreeware