Tank wars clone (newbie)
Tank wars clone (newbie)
Tank wars clone (newbie)
Tank wars clone (newbie)
Tank wars clone (newbie)
Tank wars clone (newbie) Tank wars clone (newbie) Tank wars clone (newbie) Tank wars clone (newbie) Tank wars clone (newbie) Tank wars clone (newbie) Tank wars clone (newbie) Tank wars clone (newbie)
Tank wars clone (newbie) Tank wars clone (newbie)
Tank wars clone (newbie)
Go Back  Xtreme Visual Basic Talk > > > Tank wars clone (newbie)


Closed Thread
 
Thread Tools Display Modes
  #1  
Old 08-10-2004, 06:25 PM
Mupps Mupps is offline
Newcomer
 
Join Date: Aug 2004
Location: Sydney, Australia
Posts: 12
Default Tank wars clone (newbie)


hey, i'm still relatively new to VB programming and for a yr 12 assignment i chose to create a tank wars clone.
i've got multiple forms and information passing between them etc.
my problem is that with the actual game - i dont know where to start. should i place the actual game screen (tanks on the hills) in a picturebox? or a series or pic boxes?
i've got scroll bars and buttons for the actions of the tanks up the top n botton of the window, i'm just not sure how i start the game screen.
any direction would b greatly appreciated
thanks
  #2  
Old 08-10-2004, 08:49 PM
snowboard4food's Avatar
snowboard4food snowboard4food is offline
Regular
 
Join Date: Jul 2004
Posts: 61
Default

tank wars game like scorched earth?
  #3  
Old 08-11-2004, 12:37 AM
BenK BenK is offline
Centurion
 
Join Date: Oct 2003
Location: Melbourne, Australia
Posts: 176
Wink

The simplest way to do this would be to have a picture/image box for each item in the game

easier if there are always gonna be the same amount of tanks for each game then you chould have an Array of "Tanks" and a control array of picturebox with each picturebox representing each tank. Since tank wars is a turn based game only one picture box is needed for the bullet and one large picture box to display the ladnscape. But if it starts getting complex or you want to make a better game the BitBlt or Direct X would be a better way of displaying the screen, but depending on when this assignment/cat is due you might not want to take the time to learn BB or DX.

Also those graphical libraries (BB and DX) would probably be outside the scope of the assignment especially in year 12 =P, although you never know you might get extra credit. I know in during my Yr 12 I don't think any of my teachers would know how to mark an assignment if i used BitBlt.
  #4  
Old 08-11-2004, 01:30 AM
Mupps Mupps is offline
Newcomer
 
Join Date: Aug 2004
Location: Sydney, Australia
Posts: 12
Default

Quote:
Originally Posted by BenK
The simplest way to do this would be to have a picture/image box for each item in the game

easier if there are always gonna be the same amount of tanks for each game then you chould have an Array of "Tanks" and a control array of picturebox with each picturebox representing each tank. Since tank wars is a turn based game only one picture box is needed for the bullet and one large picture box to display the ladnscape. But if it starts getting complex or you want to make a better game the BitBlt or Direct X would be a better way of displaying the screen, but depending on when this assignment/cat is due you might not want to take the time to learn BB or DX.

Also those graphical libraries (BB and DX) would probably be outside the scope of the assignment especially in year 12 =P, although you never know you might get extra credit. I know in during my Yr 12 I don't think any of my teachers would know how to mark an assignment if i used BitBlt.
yeh its due soon eheh was gettin worried. Not enuff time for BB or DX so it should be verrrrryyyy crappy but ah well :P Thanks for your help
  #5  
Old 08-11-2004, 03:26 PM
William_Cain's Avatar
William_Cain William_Cain is offline
Junior Contributor
 
Join Date: Jul 2004
Location: Norway
Posts: 318
Default

What's this year 12 thing?
  #6  
Old 08-11-2004, 05:26 PM
Mupps Mupps is offline
Newcomer
 
Join Date: Aug 2004
Location: Sydney, Australia
Posts: 12
Default

Pretty much create a visual basic program. anything. most ppl are making tic tac toe or info systems (like buttons with msg boxes displaying movie info etc.) thought itd be more fun making this. looks like i bit off more than i could chew
  #7  
Old 08-11-2004, 05:34 PM
William_Cain's Avatar
William_Cain William_Cain is offline
Junior Contributor
 
Join Date: Jul 2004
Location: Norway
Posts: 318
Default

I was more interested in what it meant like:
Have you studied programming for 12 years?
  #8  
Old 08-11-2004, 05:54 PM
BenK BenK is offline
Centurion
 
Join Date: Oct 2003
Location: Melbourne, Australia
Posts: 176
Talking

I am assuming Mupps is from Australia (or somewhere with the education system) and Year 12 would be the last year in High School.

Mupps, this game can still be done, just need to limit the game abit
make the game only 2 humans player maximum then you can have two imageboxes to represent each tank

then just randomise their position and in the game loop alternate between firing one tank to another

so all up you would have 1 Picture box for the terrain, 2x tank imagebox
1x bullet image box and some variables to contain information like tank health bullet velocity and direction.

making the actual terrain and having the tanks sit on it could be a little trickier so maybe for now just leave the tanks on the ground.
  #9  
Old 08-15-2004, 03:26 PM
Mupps Mupps is offline
Newcomer
 
Join Date: Aug 2004
Location: Sydney, Australia
Posts: 12
Default

yeh i've started programming in vb.net this year (my final year at school)
thanks for the help BenK

curious tho, wat sort of process am i lookin at for making the tanks actually shoot a projectile?
  #10  
Old 08-15-2004, 06:39 PM
BenK BenK is offline
Centurion
 
Join Date: Oct 2003
Location: Melbourne, Australia
Posts: 176
Default

One way i am thinking is that everytime each player fires, you determine the X and Y speed from the angle fired (using Soh Cah Toa) and power and move the bullet picturebox accordingly and each cycle of the loop, decrease the Y velocity by whatever you gravity constance will be. Each cycle you will also want to check if the bullet has gone out of bounds or has collided with another tank.
  #11  
Old 08-16-2004, 12:56 AM
Mupps Mupps is offline
Newcomer
 
Join Date: Aug 2004
Location: Sydney, Australia
Posts: 12
Default

ah k cool , as for the actual pixbox(projectile) moving, i should use a timer and such? i'm still not entirely sure about the X + Y coordinates to, could i talk to ya on MSN or something?
its cool if not, uv been a real champ already
cheers
  #12  
Old 08-16-2004, 03:31 AM
Mupps Mupps is offline
Newcomer
 
Join Date: Aug 2004
Location: Sydney, Australia
Posts: 12
Default

i've done some work on velocity n stuff, got a few probs with it tho.
how do i compile my code into a single file so i can show ya?
  #13  
Old 08-16-2004, 11:15 AM
Iceplug's Avatar
IceplugTank wars clone (newbie) Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: Iowa, USA
Posts: 16,583
Default

No, you don't need to compile your code. If you want us to see the game, you need to post the code. Put the files into an attachment... no EXE, and then attach it here.
As for the projectiles, if you have an angle, the bullet itself will start off with velocities VX = Speed * Cos(Angle) , and VY = -Speed * Sin(Angle)
where 0 is right, and Pi / 2 (90 degrees) is up.
In the timer, you will add gravity.
VY = VY + Gravity.
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
  #14  
Old 08-16-2004, 04:44 PM
Mupps Mupps is offline
Newcomer
 
Join Date: Aug 2004
Location: Sydney, Australia
Posts: 12
Default


tis all good. got them firing and everything.
thanks for all your help guys


Cheers
  #15  
Old 08-16-2004, 06:01 PM
Mupps Mupps is offline
Newcomer
 
Join Date: Aug 2004
Location: Sydney, Australia
Posts: 12
Default

oh 2 last things,
i've got the projectile hitting the tanks with an

If imgBullet.Left > imgTANK1.Left And imgBullet.Right < imgTANK1.Right And _
imgBullet.Top > imgTANK1.Top And imgBullet.Bottom < imgTANK1.Bottom Then
etc.

wat code should i use to make the bullet recognise when it collides with the borders of the picbox?

and

how do i make the bullet reset?
  #16  
Old 08-16-2004, 07:14 PM
Iceplug's Avatar
IceplugTank wars clone (newbie) Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: Iowa, USA
Posts: 16,583
Default

If the bullet is within the picturebox, you just check if its .Left is < 0, its .Top is < 0, its. Right is > pic.scaleWidth, and .Bottom is > pic.scaleheight. If any of those conditions are satisfied, then the bullet has hit the edges.
I don't know what you mean by reset, but you can set the visible property to False to hide it, then move it back to wherever the reset bullets go to.
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
  #17  
Old 08-16-2004, 07:33 PM
Mupps Mupps is offline
Newcomer
 
Join Date: Aug 2004
Location: Sydney, Australia
Posts: 12
Default

Quote:
Originally Posted by Iceplug
If the bullet is within the picturebox, you just check if its .Left is < 0, its .Top is < 0, its. Right is > pic.scaleWidth, and .Bottom is > pic.scaleheight. If any of those conditions are satisfied, then the bullet has hit the edges.
I don't know what you mean by reset, but you can set the visible property to False to hide it, then move it back to wherever the reset bullets go to.
Thanks
  #18  
Old 08-17-2004, 02:15 AM
Mupps Mupps is offline
Newcomer
 
Join Date: Aug 2004
Location: Sydney, Australia
Posts: 12
Default

with the collision - i've got it set so that when it hits it does
MessageBox.Show("boom")

prob is it never goes away

also, i tried the collision u mentioned and it didnt work, well it did but as soon as the projectile moved a pixel it got that msg box ^above

right now i've got this

If imgBullet.Left > imgEnvironmentMAIN.Width Then
MessageBox.Show("boom")
End If

but it only works if a projectile hits the Left side of the picturebox, but nothing else. i've tried messing around with it but no luck

any ideas?
  #19  
Old 08-17-2004, 02:16 AM
Mupps Mupps is offline
Newcomer
 
Join Date: Aug 2004
Location: Sydney, Australia
Posts: 12
Default

Quote:
Originally Posted by Mupps
with the collision - i've got it set so that when it hits it does
MessageBox.Show("boom")

prob is it never goes away

also, i tried the collision u mentioned and it didnt work, well it did but as soon as the projectile moved a pixel it got that msg box ^above

right now i've got this

If imgBullet.Left > imgEnvironmentMAIN.Width Then
MessageBox.Show("boom")
End If

but it only works if a projectile hits the Left side of the picturebox, but nothing else. i've tried messing around with it but no luck

any ideas?
sorry to be more specific: the Message Box never goes away, just comes straight back once OK is clicked
  #20  
Old 08-17-2004, 07:02 AM
Mupps Mupps is offline
Newcomer
 
Join Date: Aug 2004
Location: Sydney, Australia
Posts: 12
Default

*resolved*

geh my next prob is with the installation file, it only installs the exe, but not the pics. then when i open it, it has errors about the pic's path.
i've embedded the jpgs, but not luck.
The paths of the pics are currently
imgEnvironmentMAIN.Image = Image.FromFile(Application.StartupPath & "\Valley.jpg")
when the prog is installed however, it does not place the pics in the startup folder
any ideas? this is gota be done by tmoro

this is my final prob and then i'm freeeeeeee. any help much appreciated
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Tank wars clone (newbie)
Tank wars clone (newbie)
Tank wars clone (newbie) Tank wars clone (newbie)
Tank wars clone (newbie)
Tank wars clone (newbie)
Tank wars clone (newbie) Tank wars clone (newbie) Tank wars clone (newbie) Tank wars clone (newbie) Tank wars clone (newbie) Tank wars clone (newbie) Tank wars clone (newbie)
Tank wars clone (newbie)
Tank wars clone (newbie)
 
Tank wars clone (newbie)
Tank wars clone (newbie)
 
-->