Few begginers questions
Few begginers questions
Few begginers questions
Few begginers questions
Few begginers questions
Few begginers questions Few begginers questions Few begginers questions Few begginers questions Few begginers questions Few begginers questions Few begginers questions Few begginers questions
Few begginers questions Few begginers questions
Few begginers questions
Go Back  Xtreme Visual Basic Talk > > > Few begginers questions


Reply
 
Thread Tools Display Modes
  #41  
Old 03-09-2007, 06:57 AM
Adrammelech Adrammelech is offline
Freshman
 
Join Date: Feb 2007
Posts: 30
Default


If also having a really small problem. It wouldnt be that hard to do I just cant get it to work right. When you create a character, you can pick what class you want. I want to have a picture that corresponds with the class they chose on the next form.

I figured out the picture box but i still havent figured out what the best way to put in equipment would be.

Last edited by Adrammelech; 03-09-2007 at 04:59 PM.
Reply With Quote
  #42  
Old 03-09-2007, 10:49 PM
Targe Targe is offline
Contributor
 
Join Date: Nov 2006
Posts: 615
Default

use the picture clicked or double-clicked method and move the picture to the equipment slots or something like that. you could also drag the picture with the mouse and have it get dropped to the equipment slot. i've tried both ways, took some work to figure out the code, but the effect is nice.
Reply With Quote
  #43  
Old 03-11-2007, 04:55 PM
Adrammelech Adrammelech is offline
Freshman
 
Join Date: Feb 2007
Posts: 30
Default

Ok, where im at now in the game is adding the equipment/items/ect...I dont know a good way to put all this into the game.Would I have to put it in a module and have like (e.g) Dim SwordName as String, Dim SwordDescription as String, Dim SwordPower as String. cause it seems like there would be a much easier way to do that but I dont think I know how.
Reply With Quote
  #44  
Old 03-12-2007, 07:56 AM
Adrammelech Adrammelech is offline
Freshman
 
Join Date: Feb 2007
Posts: 30
Default

I tried to get help for saving again(since I still can't get it to work) and I got:

Code:
<Serializable()> Public Class character
Public CharName, CharPassword, CharLevel, CharGold, CharClass, CharStrength As String
End Class

Private characters As New List(Of character)

Private file As String = IO.Path.Combine(Application.LocalUserAppDataPath, "my.dat")Here is the load and save serialization methods:

Code:
Private Sub savedata()
Dim ser As New System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
Using fs As New IO.FileStream(file, FileMode.Create, FileAccess.Write)
ser.Serialize(fs, characters)
End Using
End Sub

Private Sub loaddata()
If IO.File.Exists(file) Then
Dim ser As New System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
Using fs As New IO.FileStream(file, FileMode.Open, FileAccess.Read)
characters = ser.Deserialize(fs)
End Using
End If
End SubUsing the class and collection is same as with all other classes and collections, here I create a new character instance and set some properties for it and add it to the collection:

Code:
Dim c As New character
c.CharName = "some CharName"
c.CharClass = "some CharClass"
c.CharGold = "some CharGold" 'etc
characters.Add(c)Here I have a look at all the characters in collection:

Code:
For Each ch As character In characters
MsgBox(ch.CharName)
Next
___________________________________________________________

But I dont understand most of it and I dont know where any of it would go.
Reply With Quote
Reply


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
Few begginers questions
Few begginers questions
Few begginers questions Few begginers questions
Few begginers questions
Few begginers questions
Few begginers questions Few begginers questions Few begginers questions Few begginers questions Few begginers questions Few begginers questions Few begginers questions
Few begginers questions
Few begginers questions
 
Few begginers questions
Few begginers questions
 
-->