Exactly Do Classes Make Programming Eaiser?

Apr 16, 2012

So i learned about classes today and i am totally confused about them. How exactly do they make programming life eaiser? I though Functions and Sub Procedures were making my programming life easier

View 4 Replies


ADVERTISEMENT

Make Own Classes In .net?

Jul 22, 2010

I've often wondered why would you need to make your own classes in vb.net? What purpose can they serve a typical application that cannot be already down without creating them?

View 2 Replies

Game Programming :: How To Make Pic Follows Another One

Jan 5, 2011

When my picHero enter a room where a picEnemy exists I should make the picEnemy follows picHero no matter how it moves up, down, right, left and as picHero is moving 5 px i want to make the picEnemy moves 4 px. I've tried to do use a condition as
Code:
if(picEnemy.location.X <> picHero.location.X) then
location = new point (picEnemy.location.X+4, picEnemy.location.Y)
picEnemy.location = location
endif
Also for the Y axis, but it didn't work.

View 18 Replies

How To Make Database Programming

Jul 30, 2009

I am working with MS Visual Basic 2008 Express Edition and MS Access 2007. I have managed to populate a temporary table with data from a text file containing eight fields. I have applied the namespace System.Data.OleDb What I want to do now is: 1) to order the data by a specific field (let's say Fld4); 2) delete duplicate records; 3) append the sorted data to a main table; 4) write the data from the temporary table to a new text file and save to a folder; 5) clear the contents of the temporary table

View 3 Replies

Make A Project For Programming Class In VB?

May 11, 2009

i have to make a project for my programming class in VB and this is basically what i want to do in pseudocode form

1. Display initial form

2. Choose from one of two to four choices (my discretion) via Button or radio, whichever is easier
3. once you click next, or the choice button, display next form depending on which choice and close the old form.

View 3 Replies

Game Programming :: How To Make A Picture Box Bounce

Dec 19, 2009

Im New To VB and i was wondeing how do you make a picture box bounce from the sides of the form.

View 8 Replies

Game Programming :: How To Make Question Box (msgbox)

Jul 8, 2010

I am making a game in vb.net and was wondering how to make question box eg. if a person clicks on a button he gets a message boxs which asks him a question he has to answer. the msgbox should have a text box or something for input and if their answer is the same as the one i have specfied then the message box says correct. if not then says it is wrong.

View 6 Replies

Game Programming :: Make A Manabar That Will Drain?

Jan 8, 2010

I'm trying to make a manabar that will drain, using this code

Code:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Start()
End Sub

[Code]...

View 7 Replies

Game Programming :: Make An Object Move?

Aug 13, 2009

something like this

pctObject.horizontalPosition += 5

I just dont know the right syntax

View 2 Replies

Make Base Interface For Generic Classes?

May 25, 2010

I'm trying to create a base interface for a class of mine that uses generics. However, I cannot figure out how to declare a property of the interface when its type won't be defined until the class is initialized.

To clarify, consider List(of T), which according to msdn, implements IList (among other things). Note that IList is not the same as its generic counterpart IList(Of T). So that mean any List(of T) can be converted to IList, which simply returns an object for its items. That's what I want to do with MyClass(of T), be able to cast it as IMyClass regardless of what T is.

But when I try such as:

Interface IMyClass
Prop A as Object
Class MyClass(of T) Implements IMyClass
Prop A as T Implements IMyClass.A

I get a signature error for the last line, even though object is broader than T. What am I doing wrong, or how exactly did Microsoft manage to make List(of T) implement IList?

View 9 Replies

Make Classes/Modules/arrays And Objects?

May 18, 2010

This probably sounds daft, but im struggling to get to grips with Classes/Modules/arrays and objects, as well as there uses and what they are, and yes im still coding some how i hear you cry.The reason i ask is because Ive got a load of Dim's in my program that are the same giving locations of files and folders and wondered can they be used as a module that i can alter after the program is built, incase of folder locations being wrong or moved, manually correct after install.

View 1 Replies

Make Subroutines / Properties Inactive In Classes?

May 27, 2010

I am working on a bitmap class module in Visual Basic 2010 that has an option to create a graphic grid on the bitmap.

[code]...

View 3 Replies

Game Programming :: How To Make Ghosts Chase PacMan

Mar 22, 2011

I am having some trouble working out how to make the ghosts chase PacMan. I have made all the code and stuff work with needing a grid maker thingy. I have do in all by placing the walls (pb's) myself and also with the pelets (food). Though I have a problem with getting the ghosts doing their job, they only just change image with a timer tick. Any simple way of making the ghosts chase you?

View 4 Replies

Game Programming :: Make A Button Spawn An Object?

Dec 20, 2009

I have a button named cmd_Grunt and a picture box named pb1_Grunt. I want to click the button and have a picture box created.

"Public Class Form1
Dim grunt = (50)
Private Sub cmdGrunt_Click(ByVal sender As System.Object, ByVal e As

[Code].....

This is the code I have so far. I get an error message, "Expression expected." It wants the expression between "CreateObject" and "('pb1Grunt', grunt))".

ie cmdGrunt_Click(CreateObject HERE ('pb1Grunt', grunt))

View 19 Replies

Game Programming :: Way To Make Screen Follow Sprite?

Nov 18, 2008

is ther any way to make my screen follow my sprite? I want the visable area of my game to change when my sprite moves past this X value 284 but i can not figure it out ill post my VB Express code below

Code:
Public Class Form1
Dim Y As Integer

[code].....

View 2 Replies

Using Partial Classes To Make Two Equivalent Codebehind Pages In VB

Jun 15, 2012

We are using T4 to generate our .aspx and .vb files. Everything works well - but we often have to customize behavior on the pages. However, we also occasionally have to regenerate pages - which has the potential to wipe out work which would otherwise still be valid. I would like a setup like this:

Default.aspx 'which would contain the controls
Default.aspx.vb 'which would bind, load and save data
Default.behaviour.vb '(or something like that) - which would store the behavior

With both the pages being able to reference the controls. Is that at all possible? [Code]

View 1 Replies

VS 2010 Make Classes Import Into Main Form.vb

Mar 20, 2012

I was just wondering how you can make classes import into your main Form.vb

Let's say I make a class with the following.

Public Class OtherStuff
Public Sub HideMe()
Form1.Hide()

[Code]....

How could I make the Form1.vb include the things that are in OtherStuff.vb.

All of the solutions that I have tried come up with the same error. Reference to a non-shared member requires an object reference.

View 2 Replies

Game Programming :: Dice Rolling Program - When Using Rnd Fucntion How To Make It 1-6 Only

Dec 17, 2008

So my question is, I'm wiriting a VERY basic dice rolling program for my computer programming class in high school. I'm using a randomize function to generate numbers but I only want it to do numbers 1 - 6....how do I do this?

Dim x As Integer
Randomize()
x = CInt(10 * Rnd())

Dim Y As Integer
Randomize()
Y = CInt(10 * Rnd())

That is my code for my x and y (each die) to generate code, but how do I make it do 1 - 6 ONLY? Develope a game that in which a player rolls two dice. Each die has 6 faces. Each face contains 1, 2,3,4,5,6 after the dice have come to rest the sum of the spots is calculated, if the sum is 7 or 12 on the first throw, the player wins. If the sum is 2,3, or 11 on the first throw, the player loses, and the house wins. If the sum is 4,5,6,8,9,10 on the first throw the sum becomes the player's point. To win, a player must roll the dice until the plater rolls the point value. The player loses by rolling a 7 before rolling the point. I also have another question, How would I set this up to keep up with points and stuff? and the part that says "The player loses by rolling a 7 before rolling the point." I have no clue what to do on that. I'm not asking for code hand outs. I'm just asking what functions and such I'd use to write the code.

View 6 Replies

Game Programming :: Make The Program Know When A Black Stone Is Surrounded?

Oct 23, 2009

I'm not positive if this should be here or in graphics so I'm sorry if I'm posting it in the wrong section.I'm trying to make a program for the game Go. Now before getting upset that I want to make the game go I just want to say that I have looked for months for this specific thing and I still have yet to find it. I want to make something to simulate go so that two people can play on the same computer. The problem I ran into was capturing stones. Stones are captured when surrounded and then they are taken from the board. The problem is that I don't know how to make the program know when a black stone is surrounded.

I have thought of a grid detecting but the possibilites on a 19x19 area are too high for anybody to sit down and program. I have also thought of using picture boxes and the edges to detect other pictures, but there are ways for stones to group together and the opponent must surround all stones to capture them.

View 3 Replies

VS 2005 - How To Make Custom Base Classes Available To Future Programs

Oct 22, 2010

I have written multiple programs in the past that deal with cad data. Points, lines, arcs, etc. For each program I ended up creating slightly different versions of some really base classes like a class that defines a point:

<Serializable()> Public Class Point
Public x As Double = 0
Public y As Double = 0
Public z As Double = 0
End Class

My question is how would I use that class in such a way that it could be in a namespace and imported into any future project that I write?

View 2 Replies

Game Programming :: Make An Hpbar That Changes Color With Respect To Percent Health?

Dec 22, 2010

does anyone know how to make an hpbar that changes color with respect to percent health?ive been trying to come up with an algorithm that would give me r g b values depending on how much the character has left (%).

Supposedly if the character is near death or has low hp, the algo would out put r=255 g=0 b=0 and if mid health r=0,g=255,b=255 (or watever yellow is), and if full g=0. but i need a smooth transition

View 2 Replies

Game Programming :: Make Snake In VB For Major Year 12 Project In Australia?

Apr 3, 2008

im trying to make snake in visual basic.net for my major year 12 project in Australia and i cant get it to work?

View 5 Replies

Want To Make Text Based RPG Game Will 'upgrade' As Programming Knowledge Grows

Dec 12, 2011

Well this is a re-post now as nobody replied in the gaming section, and i believe this question could go as a normal VB question, therefore I'm asking in this category instead.I have decided to pick up on programming and want to make a text based RPG Game i will "upgrade" as my programming knowledge grows.I got some ideas that i think i should use, but i want you guys' opinions on it.I assume I'll use different classes for each monster, which will have properties.Should those monsters then be inside a list of all possible monsters, or would i have a monster class which i would use and generate the enemies when needed? And would i use the same approach on items and character stats?

View 4 Replies

Game Programming :: Make For Loop Stop Once Username And Password Have Been Found Correctly

Feb 24, 2011

I have a login in system that i'm creating for a game. I have this code for checking to see if the username and password are correct in the text file.[code]I want to know how to make the for loop stop once the username and password have been found correctly.Also, where would I put a message box saying that the username or password are not correct if they don't match up or they're not in there at all?

View 3 Replies

Use LINQ To Filter Collection Of Nested Classes To Yield Dictionary Of Unique Properties Of Those Classes?

Jan 23, 2012

I have two classes, one nested in the other. [code]Neither "Name" or "ID" are unique between operations and records.I wish to construct a dictionary using LINQ = Dictionary(Of String, Of List(Of Integer), whereby the keys are uniqe examples of Names in my collection and the values are the collective set of distinct IDs that are associated with those names.

View 2 Replies

VS 2010 Structure Classes So That The User Interfaces Though A Single Class While The Supporting Classes Are Hidden From Their View?

Jun 13, 2012

How can I structure my classes so that the user interfaces though a single class while the supporting classes are hidden from their view? I think its best understood in an example:

Public Class MyInterface
Public Economic as EconomicClass
Public Sub New()
MyBase.New()

[code].....

So you might ask why am I even separating them? It's strictly for others who will be working with this interface. I need to funnel them though a logical structure:

interface.Economic.MyMethod
interface.Currency.MyMethod
etc

This way everything is already handled for them in the background and they only need to run the method they need. I don't know if I can have it both ways in VB.NET.

View 23 Replies

VS 2010 Calling Subs And Functions Within Classes That Are Within Classes?

Oct 24, 2009

Here is some example code of what I mean:

vb
Public Class Form1
Private Sub Button1_Click(ByVal sender as Object, e as systemEventArgs) Handles Button1.Click

[Code]....

View 5 Replies

Best Programming Language For Programming Windows Applications?

Jan 28, 2012

I have recently taken a liking to programming, and have programmed a few games in C#,my friend has asked me to program an application for him to use in his shop. But I have no idea of what language is best suitable?

View 8 Replies

Derived Classes Cannot Raise Base Classes

Jul 10, 2009

I m trying to raise Click event of Textbox explictly but I m getting "Derived classes cannot raise base classes" error.[code]....

View 1 Replies

Game Programming :: Make A Game In VB In Which Character Can Move Around, Jump, And Kill Things?

Apr 2, 2008

im trying to make a game in visual basic in which your character can move around, jump, and kill things. I can get the picture box with the character to move and everything is fine. but i did run into one problem. when the character moves over a tree (or something) you can see the gray backround of the character as i made in paint. how do i make the backround of the picturebox transparent?

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved