I was wondering how do you set it so that you can go from one form to another by clicking a command button (and how to make a server for an online game)
So you want something done that beginners can do easily as well as do something obviosuly way too advaced for you? Before I solve your problem, how much programming experience in VB do you have.
I set one form to be visible but if i set the other to be not visible it shows an error ( i also have no idea how to make a server though). Can you tell me how to make an icon move also
Let's do things one at a time here. The server stuff is way out of your league. Plus you must have some DirectX7 or DirectX8 and maybe some Winsock experience to do that. But if you want to learn your server stuff anyways, it's your funeral:
It's not a map per say. You pick the objects located on the toolbox to put on the form. Then you can place them anywhere within the form and put code within them for whatever events you need. Using pictureboxes or imageboxes as tiles is not the way to go. There are better ways.
Now I see where you are getting at. You want to make games right away right?
it's kinda like that. It's just i dont knowhow to set the map size, properties for certain parts of the map (to make it stand up), and how to make a sprite that you can control and move
One thing though. The Form is NOT a map. It's just a window. So you do want to make games. Alright. Well you come to the right place and all, but you must know some basic programming concepts before moving on. Have you worked with the following yet?
If..Then...Else statements
For...Next statements
Select Case
Do...Loop
While....Wend
Do While...Loop
Do Until....Loop
Dim Your_variable_here As Data_Type
With.....End With
Option Explicit
And
Or
Xor
Type....End Type
Sheesh. Uhhhh......Um......Oh boy. Hehe. Yeah, before you learn how to make games, you must know how to program first. Start off small and work your way up. That's what I did. And it didn't take me long to make games. You want to see some that I made 4-5 years ago when I was a beginner?
sure! It's just i thought at first all i had to do when i got it was just make a map, add sprites and stuff, and it would be good (i thought it was as easy as an rpg maker).
Oh it's waaaaaaaay better than an RPG maker. It's a programming language. And you can do a hell of a lot more than what some RPG maker can do, even full blown DirectX and OpenGL 3D games. Here's the really old games I've made located in this thread
My best old game I've ever written was Whack the Mole, located in that thread. My best new game I've ever....actually still working on game is Mortal Kombat vs Street Fighter. It's located here in MKvsSF.zip and plus it includes source code:
Ignor the pics, I solved those problems months ago. Plus it now has a skybox, and Ken animates. It's definitely not done yet though unfortunately but it's rocking! Be sure to delete the EXE file in there because it is old and has problems. The source code version of it has been highly updated with most problems fixed. Here are the controls:
Mouse: Free Look (like playing a First Person Shooter)
Keypad 8: Camera moves forward
Keypad 5: Camera moves backward
Keypad 4: Camera strafe left
Keypad 6: Camera strafe right
Keypad 7: Camera turns left
Keypad 9: Camera turns right
Keypad 1: Camera comes down
Keypad 3: Camera goes up
W: Wireframe
S: Textured
Spacebar: Snapshot
Esc: Exits the program
-/_ : Daytime
=/+: Nighttime
Left arrow: Ken walks forward
Right arrow: Ken walks backward
(Note: You can walk off the platform. Also note that Kens animation is not done. He only has one state of animation complete which is his fighting stance)
I hope you enjoy it. And definitely learn how to program.
Good games (especcially spacewarp). Are there any special books i need. i want to make a 2d offline action rpg. so how do i make hp (do i use dim as.. then what? do i put dim as string)? and how do i make a chat
Did you try my Good games which are Whack the Mole and my latest game I'm working on now Mortal Kombat vs Street Fighter? It has source code you can learn from. Although 4+ years ago (actually I have 8 years experience in VB) my code was always written sloppy and un-indented. Usually disorganized since I normally crammed it all in one form instead of using modules and class modules. Compare the code in MKvsSF to Whack the Mole and you'll see a major difference.
As for books, to save you money for now, the internet is loaded with Visual Basic source code. Have you tried www.planet-source-code.com/vb ? You can find almost anything you want in there, even stuff on making RPG's. I highly recommend you learn how to program first though. Try looking at my MKvsSF game source code and you might be confused since it's pretty advanced. Looking at my Whack the mole source code on the other hand will help you out since it's pretty beginner yet really awesome!
And you only want to declare something as string when you want to work with words, sentences, and external files like text files.
That was the site to teach you how to program. People upload their source code there all the time on pretty much anything. You search for whatever you want using the quick search located above, like a search engine only source code that's in their site.
Type "Chat" in the quick search on www.planet-source-code.com/vb and I guarentee you you'll find chat programs. But I'm warning you. It's too advanced for you. Even for me I think since I've never made a chat program or an online game....yet. But I did try. It was too hard. I plan on making MKvsSF a massive multiplayer online fighting game, but I still need to learn more on DirectPlay, which is a part of DirectX8 (as well as DirectX7).
Your best bet is to get a VB book and then go on from there
it doesnt take long to learn the basics and then I recommend you do one thing at a time. If you are talking about doing an online game then that is a long way off. Its very complicated and you need a game first
Start off with a program that can display "Hello World!" on your form, when you click a button, and have another button to exit. if you get stuck, you can post your problem in the VB forum. Then, move on to harder things.
You may find something useful that you want to make, like a telephone directory, or some simple game like Tic-Tac-Toe.
As you successfully complete these programs, you will feel good about what you have learned. If you try to make a game right now, you will probably give up quickly out of disgust, and also, give up on programming altogether.
It's not hard to learn, but once you start learning, you never stop!
well, while i'm here can i ask questions. I was wondering, i know how to maker something move, but dont know how to make it stop moving if it touches a spot, like the end of the area. what do i do
Try this. Make a new project and add a picturebox to the form. Copy and paste this code:
Code:
Option Explicit 'This makes sure all variables have been declared.
Private Declare Sub Sleep Lib "kernel32" (ByVal Milliseconds As Long) 'Needed for pausing between loops. This will be your first API you ever used.
Private Sub Form_Activate()
Dim Game_Active As Boolean 'Boolean is either always true or false.
ScaleMode = 3 'Makes the form's coordinate system based on
'pixels rather than twips.
Picture1.ScaleMode = 3 'Makes the picturebox's coordinate system based on
'pixels rather than twips.
Game_Active = True
While Game_Active = True
DoEvents 'So the program doesn't lock up and allow events to happen.
Sleep 15 'Keep it around 60 FPS. 1000 / 15 = 66.66
Picture1.Left = Picture1.Left + 1 'For every frame, move the picturebox
'1 unit to the right.
If (Picture1.Left) >= 250 Then 'If it collides at 250
Picture1.Left = 250 'Stay at 250
Game_Active = False 'Exits the while loop.
End If
Wend
End Sub
I was gonna improve it, but I noticed that it maybe too hard for you to understand, so I left it like this to where it's readable for you.
Note: Do not use the Form_Load because it does code in there before the form's loaded and will refresh and clear the window. Use Form_Activate or Form_Paint instead.
Code:
Option Explicit
AutoRedraw = True 'That way when the form loses focus and comes back, the drawing doesn't
'get erased.
Private Sub Form_Activate()
Print "Hello World"
End Sub
Alright, but I'm warning you though, this is pretty advanced. I'm going to do this by memory since I don't have VB in front of me right now. So there might be a mistake or two.
1) First of all, you will need to create a user defined data type called Sprite_Type:
Code:
Private Type Sprite_Type
X As Long
Y As Long
Visible As Boolean
Active As Boolean
'This obviously needs more but for beginner's purposes, this is fine
'for now.
End Type
2) Use the code I have above to serve as a base. Only this time I put the Sprite_Type in there.
Code:
Option Explicit 'This makes sure all variables have been declared.
Private Type Sprite_Type
X As Long
Y As Long
Visible As Boolean
Active As Boolean
'This obviously needs more but for beginner's purposes, this is fine
'for now.
End Type
Private Declare Sub Sleep Lib "kernel32" (ByVal Milliseconds As Long) 'Needed for pausing between loops. This will be your first API you ever used.
Dim Sprite As Sprite Type 'Make this an array if you want more sprites.
Private Sub Form_Activate()
Dim Game_Active As Boolean 'Boolean is either always true or false.
ScaleMode = 3 'Makes the form's coordinate system based on
'pixels rather than twips.
Picture1.ScaleMode = 3 'Makes the picturebox's coordinate system based on
'pixels rather than twips.
Sprite.X = 0
Sprite.Y = 0
Sprite.Active = True
Sprite.Visible = True
Game_Active = True
While Game_Active = True
DoEvents 'So the program doesn't lock up and allow events to happen.
Sleep 15 'Keep it around 60 FPS. 1000 / 15 = 66.66
If Sprite.Active = True And Sprite.Visible = True Then
Picture1.Visible = True
End If
Sprite.X = Sprite.X + 1
If (Sprite.X) >= 250 Then 'If it collides at 250
Sprite.X = 250 'Stay at 250
Game_Active = False 'Exits the while loop.
End If
Picture1.Left = Sprite.X 'For every frame, move the picturebox
'1 unit to the right.
Picture1.Top = Sprite.Y
Wend
End Sub
so i just paste that on the form?
I'm kinda stupid to this right now, so i might as well ask the second question. how will this put my mecha icon on it
And definitely learn how to program first like we've been telling you. Read some books on VB (not VB.NET) at any bookstore. The internet has plenty of tutorials that will teach you how to program in VB6. And it's very easy to pick it up and learn how right away. Once you learn basic concepts of programming, continue to learn more as you progress.
Now after that, you can now learn how to make games. There are numerous sites that will teach you the correct way to make video games in VB. We can't write the code for you. But we can lead you in the right direction and correct any problems you have. That's what these forums are for.
You would want to be the author of your own program, not us. I mean think about it, if you were writing a book and had no idea on how to write it, you wouldn't want smarter people to fill in the blank pages for you would ya?
so i just paste that on the form?
I'm kinda stupid to this right now, so i might as well ask the second question. how will this put my mecha icon on it
Open up the properties window to the form. Goto Icon and click on the [...] button. It'll open up a dialog box. Find where your icon is and press the Ok button.
Plus they are not icons you are refering to obviously now after reading what you are trying to say. What you are refering to are images (also known as pictures) based on file formats like bmp, jpg, jpeg, gif, etc., but not ico which are icon files. Totally different than image files man.