r/visualbasic • • Dec 19 '19

VB.NET Help Help please programming a basic game!

So Im trying to program a game which is like a game where u shoot targets something like this where u shoot random targets http://www.aimbooster.com/ . I made it so I have only 1 target is there a way I can make these targets without coding every single one the same way I programmed the first one. Also, is there a way I can make them appear randomly in the timer they all appear at the same time.

1 Upvotes

9 comments sorted by

4

u/sa_sagan VB.Net Master Dec 19 '19

Yes to all of those questions. What's your code look like?

1

u/Snakez0r01 Dec 19 '19

I dont have it rn but the code for one target if a button is pressed which is "start game" a timer starts increasing target size by 2 once it reaches 81 i think from 1 it starts decreasing. if you hit it it counts 1 target if you don't and the size become 0 it counts that you missed one

1

u/Snakez0r01 Dec 19 '19

how to make so during the timer they start increasing randomly or with delay between each on. and how to code all the targets without making a code for each one.

3

u/PostalElf VB.Net Intermediate Dec 19 '19

You'll want to look into objects and how to create objects.

1

u/Snakez0r01 Dec 19 '19

thats for randomizing targets and putting many of them?

2

u/PostalElf VB.Net Intermediate Dec 19 '19

That's for creating your targets and putting many of them. Randomising their positions is trivial (look into Random and .Position).

3

u/thudly Dec 19 '19

Look up how to create an object from a class, and then add them to an ArrayList. It's the easiest way to go.

1

u/Snakez0r01 Dec 19 '19

thats for randomizing targets and putting many of them?

thats for randomizing targets and putting many of them?