Ok well, since this is a blog about prog and I'm starting on a very boring and prog-less path. So ! My next post is going to be about some programming stuff, still in VB.net because I like it very much and its easy to explain.
Not sure when I'll make another post, probably in less than 6 months though.
This is a blog to talk about programming. I am a student in IT currently working with the C# language.
Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts
Saturday, February 5, 2011
Thursday, March 11, 2010
Milestone achieved !
The Proof
Well I finally have something to show as a proof of concept:
Isn't that awesome ? Megaman standing on a map full of road and grass ! I made the image extra large so you all could see it. The simplicity of this piece of program is more complex than you can image. I will deploy a few images to explain what code I used to piece this up.
First I used both the "ArrayMap" and the "GridMatrix" technique from earlier posts. I have two arrays - BasicRoad and SpriteMap, that contains the values of which tile and sprite to apply in which position of the matrix ( as seen on the left ).
Afterwards I took the images from the matrix and put them inside a picturebox-like class and placed the tile on the form.
Next I had to do the same with the sprites, but unfortunately I had a problem. My idea was to place the sprite in a picturebox and put that picturebox on top of the tile he's resting on. But there is no opacity property on pictureboxes so wherever I put the sprite he was hiding the tile under him. Making an ugly hole in the map. to solve this problem I used the backgroundImage property and took the image of the tile he's resting on and applied it as background.
I created two classed derived from picturebox: GridTile and SpriteTile so when I scrolled through the form I could use their type to get only the tiles or only the sprites.
Well I finally have something to show as a proof of concept:
Isn't that awesome ? Megaman standing on a map full of road and grass ! I made the image extra large so you all could see it. The simplicity of this piece of program is more complex than you can image. I will deploy a few images to explain what code I used to piece this up.
Then I created a method to take the values in the BasicRoad array to decide which image to place in the tiles matrix.
Next I had to do the same with the sprites, but unfortunately I had a problem. My idea was to place the sprite in a picturebox and put that picturebox on top of the tile he's resting on. But there is no opacity property on pictureboxes so wherever I put the sprite he was hiding the tile under him. Making an ugly hole in the map. to solve this problem I used the backgroundImage property and took the image of the tile he's resting on and applied it as background.
I created two classed derived from picturebox: GridTile and SpriteTile so when I scrolled through the form I could use their type to get only the tiles or only the sprites.
You can see that I am passing quite a few parameters to these classes, instead of giving them their values after I created them. I made a New() so I could give them their values directly when created. Much cleaner that way. You can see where I use the me.backgroundImage property and used the coordinates from the matrix.
I'd like to stress that this is NOT a representation of the final project. This is from the vbProject that I made to explore the mechanism that I will use in my game. I still haven't done a single line of code regarding the game itself. The sprite I used are not mine and property of their respective owner. But I can take credit for the tiles since I made them, and they are awesome.
Labels:
game creation,
grid,
matrix,
Programming,
sprites,
Vb.net
Tuesday, March 2, 2010
The steam is gone, Phew
Finally, my exam is gone and I did well. To keep dust from settling in I'd like to share this post about programming languages that I found a few months back. Hilarious.
For more of this visit this page.
Updates coming for the Design ! Stay tuned.
A Brief, Incomplete, and Mostly Wrong History of Programming Languages
1801 - Joseph Marie Jacquard uses punch cards to instruct a loom to weave "hello, world" into a tapestry. Redditers of the time are not impressed due to the lack of tail call recursion, concurrency, or proper capitalization.
1842 - Ada Lovelace writes the first program. She is hampered in her efforts by the minor inconvenience that she doesn't have any actual computers to run her code. Enterprise architects will later relearn her techniques in order to program in UML.
1936 - Alan Turing invents every programming language that will ever be but is shanghaied by British Intelligence to be 007 before he can patent them.
For more of this visit this page.
Updates coming for the Design ! Stay tuned.
Saturday, February 27, 2010
Software Development Process
So I've been reading a few wikipedia articles ( namely this one, and that one ) about software development planning. For it has always been a problem for me, I never finish any project I start because I have no plan to stick to and always find that I can do "that part" in another way and want to re-write the whole thing.
Now, things will be different. After those articles I managed to grab the essential of the concept of making a plan and sticking to it and not jumping to the implementation process too soon. And so I have chosen the waterfall model for my process.
So I am now jumping into the "Planning the requirements and specs" stage. What purpose will my game serve? Whats the point of it ? I will make a post about this stage when I am done or simply to update.
Now, things will be different. After those articles I managed to grab the essential of the concept of making a plan and sticking to it and not jumping to the implementation process too soon. And so I have chosen the waterfall model for my process.
So I am now jumping into the "Planning the requirements and specs" stage. What purpose will my game serve? Whats the point of it ? I will make a post about this stage when I am done or simply to update.
Thursday, February 25, 2010
Classes Overview
Today we had to use classes. I will try to explain briefly what classes are, without going into too many details, because this is a deep subject.
First off classes are concepts of "things". A thing can be pretty much anything you can interact with. Chairs, tables, cars and clothes are all classes. Objects are physical representation of those concepts ( or logical, in the case of computers ). The particular chair you are standing on is the physical representation of the "chair" concept. Chairs are things which have several legs and a plate on which you can sit. But the one you are sitting on right now may have a number of legs and style and paint, it is unique ( even more unique when you think about the atoms making your chair ). Class = Chairs and Object = [The one chair you're sitting on].
Creating a class is made that way:
Public Class Car 'The class definition
Dim typeOfCar as string 'This is called a Member, it is specifically a property of a class (i.e a variable )
Sub nameCar(byval newValue as string) 'This is another member, it is a procedure.
typfOfCar = newValue
End Sub
Sub nameCar(byval newValue as string) 'This is another member, it is a procedure.
typfOfCar = newValue
End Sub
End Class
By inserting the following snipper we have now created a Class called Car, it is a very general and broad class right now. It has a single property called typeOfCar that defines what type of car we're talking about. Right now it has no value so it can be anything. It a concept. When we create it, we define the car. We give it a brand, a name, a maximum speed, number of doors and etc. This is called an instance of a car. And creating an instance of a class is as easy as creating any other variable.
Dim MyViper as New Car
MyViper.nameCar("My Big Car")
We now have a living representation of a "car", its a dodge viper and its name is "My Big Car". We have given it a name using our member by accesing it using the syntax Class_Name.Procedure_Name
As you see, an instance of a class is an object. And the class itself that defines the procedures and properties is a Class. By using Object Oriented Programming you can do many things functional programming cannot do. The code you make is a lot neater and well structured. OOP is a lot more complex than that but thats all I'm going to risk explaining else if make some error and give you bad knowledge. That is all for today, hope to see you next time !
By inserting the following snipper we have now created a Class called Car, it is a very general and broad class right now. It has a single property called typeOfCar that defines what type of car we're talking about. Right now it has no value so it can be anything. It a concept. When we create it, we define the car. We give it a brand, a name, a maximum speed, number of doors and etc. This is called an instance of a car. And creating an instance of a class is as easy as creating any other variable.
Dim MyViper as New Car
MyViper.nameCar("My Big Car")
We now have a living representation of a "car", its a dodge viper and its name is "My Big Car". We have given it a name using our member by accesing it using the syntax Class_Name.Procedure_Name
As you see, an instance of a class is an object. And the class itself that defines the procedures and properties is a Class. By using Object Oriented Programming you can do many things functional programming cannot do. The code you make is a lot neater and well structured. OOP is a lot more complex than that but thats all I'm going to risk explaining else if make some error and give you bad knowledge. That is all for today, hope to see you next time !
Labels:
class,
objects,
OOP,
Programming,
School,
Vb.net,
visual basic
Hello World
Hello, and please be comfortable. This is my new blog in which I will talk about my passion: programming. As a young adult with very few experiences in the domain this will not be a breakthrough in computer programming concepts nor will it be particularly advanced. I've been studying in IT for 2 years and started experiencing with programming languages 2 years before that (with HTML, even if this is a markup language and not really programming it is still closely related ).
I am currently studying the Visual Basic.net language and will therefor make my articles in this language although I might branch off in another for demonstration purposes. Without further ado:
' I like colors by the way
console.writeline("Hello World !")
exit
Labels:
.net,
first post,
Hello World,
Programming,
Vb.net,
visual basic
Subscribe to:
Posts (Atom)

