
Denaes
Avatar/Signature-
Posts
975 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by Denaes
-
Maybe it's not good form, but I'm constantly adding private variables as I'm coding and/or changing their names... sometimes changing the public variables. Like for example, each room has 4 potential doors. This is hardcoded as it won't change. I started off with: Exit1 Exit2 Exit3 Exit4 Which really didn't make any sense. I quickly changed it to: ExitNorth ExitEast ExitSouth ExitWest This was more descriptive. Then I realized each door had properties such as a type and potential difficulty (lock/trap). Now I'm at a point where I realize it's far easier to display using: ExitUp ExitDown ExitLeft ExitRight And I'm contemplating creating an entire class to handle the 8 variables and a method or two: ExitInformation +UpType +DownType +LeftType +RightType +UpTarget +DownTarget +LeftTarget +RightTarget getUpString() getDownString() getLeftString() getRightString() -Flip (a method that internally flips Up with Down) Actually that looks like a pretty well developed class. I feel that I can cut it down further by making each of the directions a class also and instantiate them within the ExitInformation Class... Of course this change will play hell with my interfaces :) I suppose I should really do more writing down... and planning and refining before coding.
-
I can't affort Visio right now, do you know of a free/inexpensive tool for this? I'm planning on getting the MSDN Universal Subscription soon (next few months) which includes Visio. I have two books on this and I know the basics to at least get classes down on diagram (not really sure about their interaction in diagram yet). I've heard Visio can be an unbelievably awesome tool for use with Visual Studio as you and import/export UML into/from classes in the project
-
Theres not really anything to refactor yet. I'm planning out how to have all the objects interact. I need to have a class which drives the game which drives it through the phases (it's turn based with multiple phases in each turn). Maybe I'll have that as my SubMain and load the form from there. I suppose that's where all of the settings will need to be and it can expose them for other classes to set/get as literally about a hundred classes can change/use these settings. As a background, it's a turn based card game which creates a map using one deck of cards... it's basically a card game crossed with a board game. Each player takes on a persona with special attributes and special abilities. Each turn is made up of the following breakdown: 1. Upkeep - everything resets for the turn. Players can't really do anything in this phase. 2. Card - Players may play cards on other players/characters in this phase - rarely on themselves. Any card you play will have a unique effect wich might be instant or perminent. 3. Build - this is where someone takes a card from the build deck and places it to expand the board. 4. Player - this is the phase you move your character around on the board, play cards to help your character and possibily initiate a challenge of sorts with other players in the same room. 5. Discard/Draw - you discard a card and draw so that you have 5 cards. So basically I need to setup each phase and then Wait for the player to do something. throughout the phase they'll be getting/setting information (dealing damage, moving, etc) All the while I need to keep it modular to allow for optional rules. I sense much refactoring going on as I develop. Actually I see this working out with a Game Class with a subclass for each phase, exposing properties and methods specific to each phase and then the Game Class exposing properties and methods specific to the game itself... Right now it's going to be hotseat but I want to at least attempt to compile it for the monoframework for OSX/Linux users and also allow for cross network/internet play.
-
I'm doing a game and there are many variables that need to be shared across many classes (and in some cases across libraries). I do not want to just declare things as global and I don't want to deal with a nightmare of passing an object around as an argument every time something needs to get done. I just fear two different classes updating the object at near the same time and it just hurts my head. How about a shared Class? Or whats it called where you don't even have to instantiate it? Just have a class that everyone can access. I'm not quite up to this step, but I'm going to have to seriously plan for it soon. Any advice?
-
J#, C#, VB.Net - all about 99% the same. I'd say VB.net is further different from J# and C#. J# is called J# because it's not Java. it's their port of its syntax for .Net. If you're not INTO Java I'd suggest going with C#. very similar and you'll find a ton more documentation help on it. The only great benefits I've found from J# that the other .Net languages cannot do (I have no evidance that C# or VB.Net can do this) is to create a webcontrol that acts as a web applet. It's apparently a fairly straightforward conversion from a normal Java Applet. If you want to do Java, I suggest downloading Borlands JBuilder 2005 Foundation. It's free - even for commercial use - is a fully featured IDE with code completion and compiling within the IDE. I don't like it as much as Visual Studio - but it works well when I need to get some Java done (not very often)
-
About 3 years really. I used to do Hypercard on my Mac Plus when I was like 12 or so... but nothing else until I took a course in college and realized I loved VB6, then VB.Net much more :D
-
ok I knew there was some way to delegate this but it's been so long I was just thinking of raising events within the class itself. Let me question really quickly... AddHandler btnButtonsGalore(i).Click, AddressOf btnButtonsGalore_Click AddHandler is grabbing the event and adding it to the procedure btnButtonsGalore_Click. So this way you don't need to "hardcode" anything in advance, it just sends all those buttons' Click Event to that one procedure. That would be exactly what I was looking for. Thank you :D
-
I have an array of 4-25 objects (normally) want them to raise an event at a specific time passing the information of which one they are. Say for example I just want to send another class a string containing some data. VS says I cannot declare a variable WithEvents if it's part of an Array. Is there anyther way to get around this?
-
I'm using 2003. Is there a way to manage namespaces easily in VB.Net without typing: Namespace Events End Namespace and moving your code between it for every class you want to include? I recall one of the niftier things about C# was that it automatically set the namespace to the directory structure of your project. If you created a folder called Events within a folder called Dependancies, every class within Events is now of the namespace Dependances.Events. I'd like to just put things in a folder or just select 8 files and add it all at once... maybe I'm just lazy?
-
Is Redim in the VB Compatability namespace? I've heard that namespace is only wrappers for .Net methods with more VB Friendly names/ways of doing things. I suppose you can't really say that there is a proper .Net way when C# does it a different way and I have no clue about J#. I forgot I was so annoyed about this until I just re-read it :D I told you that i was just venting because I spent like an hour working on this and it not working! Does C# also use {} to assign values? My knowledge of arrays in .Net isn't really up to snuff. I learned them in VB6 and then every time I try to do something in .Net with Arrays I end up getting stuck somewere and just use an ArrayList or Collection and it's much easier :D It's just that this is a grid so it lends itself much better to a double array rather than a collection. Thank you for your help, I really would like to see more on ReDim and how it compares to others in performance. As for converting I use either cType(,) or the actual class: Integer.ToString() Integer.Parse(), etc. I forgot that cint, cstr, etc were still here. You say they have better performance also?
-
Thats a good idea. Just have a shared library of interfaces. Thanks :D
-
Public Interface iPersonName Property LastName() Property FirstName() Property MiddleName() End Inerface How about if I declared this in three seperate libraries? I declare it (same name, same signiture) in Display, Logic & Data. Each library uses their own declaration. a class implementing Display.iPersonName will be uncompatable with Data.iPersonName? So you have to build your libraries using exposed public interfaces and program specifically for Display.iPersonName for this to work? So my Data library would work with any other library so long as Display.iPersonName was exposed?
-
I'm thinking of working with 2-3 libraries (.dlls). One for data, one for logic and then the application which displays. Now if I need to pass a class type with a specific interface from Data to Logic to Display, does it just matter that the signitures match up, or are the names fully needed. I'm not sure if in the Data library if I'd use a local interface or reach across to the application, which really reduces its portability and makes it dependant on the other library to run. They'll probobly have the same name, but be declared in three different places (and namespaces) but all have the same signitures (say FirstName(), LastName(), MiddleName() just for an example).
-
I'd like to see this happen. Post rules up there and allow people to post or just submit a review to a moderator here and they put it up like in the code base/tutorials. If you let people post you would probobly need to have a mod come by and clean things up for people who don't want to read the rules. It's time for another forum and this one really does belong by itself, not burried reviews amongst General and Random Thoughts.
-
I'd second that, but I'd also request that "Reviews" be for more than books and follow a standard format for the post + title.
-
This is a great book! It's entertaining, uses images, normal text/situations - it actually stimulates your brain to make things fun. It uses learning technologies/techniques to make information come alive and stick in your brain. This is actually a Java book, I've been using it for VB.Net. The C# code for it is like 98% identical. I've only taken one semister of Java (and trust me, not much sunk in :D ) and I'm having no problems translating it to VB.Net. I'm actually taking all the Java code they have and retranscribing it in VB.Net. So far I've learned some advanced OOP priciples (interface programming) and the Observer pattern. I'm working on the Designer Pattern now. I've known what interfaces were for a while, but I didn't really know. :eek: I thought interfaces were just about enforcing programming practices between teams... I had no idea how cool they could be in exhanging classes in collections and for extending classes dynamically at runtime... It's like I'm starting to think I can understand Divils tutorials soon! I'm only on chapter 3 right now - not entirely sure how to implement the Decorator Pattern, but it looks useful. This is the sort of book that's just cool to read :)
-
That's fricking annoying :mad: We should just use brackets in VB! And I'm a VBer, not a C#er wanting to turn VB into C#. This is just silly. So I have to include the curley braces even though I'm not going to assign anything... That would explain the problem. But it allows me to do this MUCH easier!
-
I'm going to need these "Squares" to display (and keep track of) 0-6 pieces of information, interact with the (up to) 4 squares touching them, allow interactivity with mouse (over and click) events and possibly display an image on each one as well. This is something I can create in a control in like 30 seconds, I can't even imagine the headache of keeping track of all this information in their own arrays and drawing and detecting where the mouse is moving/clicking... Besides, right now this is just somethings to get my application logic in the view and running. I can change this at a later point if it ever becomes a factor. Thank you for your help, I'll give it a try!
-
Really? I havn't had it crash yet. The only thing I've noticed was the "tutorial" to work with the DVD collection application which opens buggy (it doesn't always add the picture, year, description, etc into the database) and uses a whole load of custom controls. I think like 4-6 created for the application and the VB.Net Control Pack.
-
I have a control I'll call GameBoard, which contains numerous 4-100 (right now) controls. This is set as a property in GameBoard and they're always amounts that are equally squared: 4, 9, 16 - which would translate into 2x2, 3x3, 4x4 grids when displayed. Obviously this lends incredibly easily to a 2d Array. So I tried this 2d Array for like 45 minutes and couldn't get it to work. I followed the MSDN and an example on this site I found searching and nothing. I tried to declare the array with my other private class level variables outside of a procedure: private arrGrid(,) as GridSquare Then: Sub New() ' TotalSqrt is the SquareRoot of the number of squares in total needed ' in the GameBoard. ' ie 16 squares would have a TotalSqrt = 4. arrGrid(TotalSqrt, TotalSqrt) = new GridSquare ' Or arrGrid = new GridSquare(TotalSqrt, TotalSqrt) End Sub I've tried this a few different ways, but this is the jist of it. Can anyone help me declare this properly?
-
Well, the grid is contantly changing, might be 10x10 or 100x100 and I'll need to resize it at least to 50%, 100%, 150% and maybe 200% to accomidate different monitor sizes and user comfortability. I ended up going with 2 custom controls. One is just a rectangle with a black border (I might add further functionality to it at a later date) which is created as an array within another control which basically has all the setting options. This lets me change the size of the space between grid squares, grid square size, Grid Square colors individually and also easily check if someone clicked on a particular grid square and find grid squares easily. I wanted to have a 2d Array of these controls/classes within the GridContainer, but after 45 minutes of trying to create this array I just created a 1d array. This will really make performance worse as I have to keep cycling through the array checking X/Y values rather than just references the X/Y as the array indice Anywho, I'm sure that this can all be done via a picture and drawing on the picture, but it's beyond me at the moment. I seem to like the grid units being extensible and being able to add more features to each GridSquare.
-
Beta 2 will have a GoLive Liscense!? Right on! 2.0 is downloadable off of Microsofts website, so I'll start using VB.Net Express again :D
-
Beta 2? I havn't been following up much on the express or studio betas, but what I've used was top notch and performed better than 2003 did with a better interface and features. Are there any major known bugs in Beta 1? I'm surprised that I couldn't google any of this information up. ::Jinxed so that someone will show up and proove me wrong:: I'm looking into the MSDN Universal Subscription and don't mind playing around extensively with these great betas but it really ties a knot in learning ASP.Net when my server doesn't have 2.0 yet .
-
I created a control, which is just nothing more than drawing and figuring sizes for a grid. I need this as a control because the grid will be much larger than the form and I need other controls all around on the form. So i figure to have this GridControl in the middle. Since I'm just drawing rectangles on it via GDI+, AutoScroll isn't working. I have to stick an actual control there... which I'm thinking of doing... maybe a picturebox with a picture to hold the grid "open" so it's scrollable. Yes, this is a real sad way of doing it. On the other side I'm thinking of just adding scrollbars and figuring out how to get the control to scroll with them... adding code to the controls resize that they only show up if the grid will be larger. Obviously if this can be done easier, I don't want to reinvent the wheel. Is there an easy solution I'm missing?