Jump to content
xisto Community

trialsite

Members
  • Content Count

    6
  • Joined

  • Last visited

About trialsite

  • Rank
    Newbie

Profile Information

  • Gender
    Male
  • Location
    UK
  1. Great, I think we have all we need Right, first thing's first, what kind of game do we want to create? I think we have two choices, we either make a simple(ish) safe game, that's pretty much guaranteed to work, but will be limited in what it can do, or we take the more risky option and try to create something a little more creative and detailed. Personally I'd go for the second option, but this is a diplomacy after all.
  2. Object Orientated Programming What is Object Orientated Programming? Object Orientated Programming, or OOP as it is also commonly called, is a way of programming which essentially mimics how objects work in the physical world. Unlike procedural programming, which works essentially from a list of instructions carried out one after the other, object orientated programming used objects and classes, which not only save time and space, but also makes programming easier. The way it works it that rather than breaking down the problem into a series of steps to be followed, the program instead is a set of objects, which work together to perform the task in hand. It would help to first understand what an object or class is before we go any further. What is an Object or Class? Consider the example of a football team. The team is full of football players; however that is not to say that they are all the same, and share the same values. For example, they all play football, but they have different names, positions, etc? and for that reason they are different. In this instance the class that they belong to is the Footballer class, as they are all footballers. However they are all individuals, and in this instance we would refer to them as objects. However, this is not to say that an object needs to be a physical object. For example it could be a bank account, or a web hosting account. Class A class is a template from which an object is created. Every object that is created from it will have the same type of attribute, but their values may be different. Object An object is an instance of a class. Or in other words, it is an object created using the template of the class it is derived from. Fortunately using the class system you are able to reuse the class to create many objects that share similar characteristics to the class, but which have very different values. Using the football player as an example you can create many different player objects, all of which are footballers, but have different values, such as different names, positions, etc? The way the program works is that the class is created before the program loads, and then whilst the program is running, the objects are created. This means that the objects can be created as and when they need to be, which consequently greatly increases the efficiency of the program as an object is only created when it is needed. Attributes and Behaviour An object has certain properties such as (in the case of a button) colour, height, size, etc? but it also acts in a certain way once called upon (or clicked), and it is this which makes the idea of an object important. The fact that these values can be changed or altered is what allows the class function to be used so efficiently. Class Attributes Using the example of the Footballer object from before, we have already established that each footballer is different properties such as its position and name. We refer to these properties as the class? attribute. Attributes Attributes are the properties that distinguish one object from another. The values given to the attributes are referred to as variables. In the example of the Footballer, the ?position? field would be the attribute and the variable would be ?defender, midfielder or striker?. These variables are not fixed, and can change throughout the program if required. A value that does not or can not change is called a constant. Instance Variable An instance variable (also called an object variable) defines the value of an attribute of an object (or instance). Using the example of the football team, this would refer to the individual player, i.e. their name, position, etc? Class Variable A class variable defines the value of an attribute of a class. Using the example of the football team, as this would apply to the entire class it could mean different things. If all of the footballers belonged to the same team, the class could have an attribute called ?Team Name?, which would need to be the same for all players. By changing the class field it saves much more time as it will automatically apply to all of the footballer objects that have been created. For example, if there are 15 Footballer objects, if the name of the team changed, only the one class variable (which applies to all players) would need to be changed. Otherwise 15 different objects would have to be changed, and this could take a long time. Class Behaviour As with all objects (both in Java, and in the physical world) the reason they exist is because they serve a purpose; a washing machine washes clothes, a light turns on and off, etc? The actions that a class or object performs are referred to as their behaviours. Behaviour The behaviour of an object or class refers to the actions that they can perform. Like kicking a football, all actions need to be described before they can be performed. In other words, a football player cannot kick a ball without first knowing that he must place the supporting foot beside the ball, and swing the striking foot until contact is made. These ?instructions? that explain how a particular action is performed is called a method. Method A method defines how a particular task is to be completed. Objects also communicate with each other using method, whether it is providing each other with confirmation of their current location, or to inform them of a change in situation (in the case of a footballer object). As with variables, you can get instance methods and class methods. As their names suggest, an instance method relates to a method for a particular object, and a class method relates to a method for a class itself. Parameter Methods may have parameters to pass additional information needed to do the action. Inheritance Inheritance is one of the most important ideas in object-orientated programming, and it greatly affects the way in which classes are written. As a result of inheritance a class instantly adopts all of the functionality of the superclass it has inherited from. Inheritance Inheritance is where one class inherits the behaviour and attributes of another. A class that inherits from another is called a subclass and a class that provides the inheritance is called a superclass. This naturally creates a hierarchy system amongst classes (this will be explained later), and it is important in establishing the structure of the program. In practice this means that in order to create a new class you don?t have to define each of its characteristics from scratch, and instead you can simply inherit the attributes from a similar pre-existing class and just amend the attributes that differ. Class Hierarchy As previously mentioned, this creates a hierarchy whereby classes inherit characteristics of others, and consequently superclasses and subclasses are formed. The process could be compared to when a baby inherits features from their parents through their genes. The child has an original set of characteristics (in base ?egg form?) and it is then affected by other factors to change is slightly so that is different. However, no matter how different it has become, it still has ultimately inherited behaviours and attributes from their parents (this could be things like eye colour, height, etc?) Taking this analogy further you could trace it back to the Garden of Eden or the big bang, etc? It is important to note however (unlike human genes), classes can only inherit features from one other, i.e. it cannot ?mix and match? components from two different classes. However, a superclass may have many subclasses. A class only ever has one superclass, but it can have many subclasses. Using this approach it is a lot faster to create new classes, as (like creating objects) there is a template to start with. Subclassing Subclassing is the method by which a new class is created by inheriting features from a superclass. Methods Methods define objects? behaviour ? anything that happens when the object is created and the various tasks that it performs throughout its lifetime. Method Methods implement the behaviour of objects. The structure of a method consists of a header and a body. The header defines the methods signature: public int getPrice () Not all methods return a result. Some do and some don?t. This is reflected in the signature of the method. All methods with ?void? in their signature do not return a result. There are two types of method. Accessor Methods Accessor methods provide information about an object ? they ?return? it. public int getPrice () { return price; } Accessor method A method which returns data. Mutator Methods A Mutator method (as the name suggests) is used to change the state of the object. This is achieved by changing the value of one or more fields.  Typically contain assignment statements.  Typically receive values as parameters. public void insertMoney (int amount) { Balance += amount; } In the above example, it is important to point out that ?balance += amount? is the same as writing ?balance = balance + amount?. Mutator method A method which changes an objects state.
  3. The first thing to remember, is it's all about calory intake. The best thing to do is to do some form of exercise the second you wake up, BEFORE you have breakfast. Ideally go for a jog, litterally the second you wake up. This will then raise your metabolism the second you wake up.Then have up to 7 meals a day ideally, but if that isn't possible, then as it has been said already, eat like a king for breakfast, a prince for lunch, and a pauper for dinner (the three p's in decending order).The best exercises for burning calories are running, rowing or cross country skiing. Whichever you can. Ideally flip between the three to "keep your body guessing"
  4. There are a few things you can do, the first thing though is to understand why we get stitches. You get them because your stomache (and other organs) is pulling on the muscles holding it in place, therefore straining them. Therefore to prevent a stitch, you prevent the "wobbling".The best thing you can do, is simply tense your abbs as you run for a while so that your stomache doesn't move.If you're happy to stop for a while, put your hands behind your head and walk upright, breathing in slowly (in the nose, out the mouth) stretching your stomache.Hope this helps
  5. Right, this is the first post of hopefully many in this thread. Basically the idea is to get many developers together to share ideas and knowledge to create our very own game. First we'll be asking for is any ideas of what kind of game everybody would like to make, and then we'll set about assigning tasks depending on everybodies skills.We will need programmers, artists, web-designers, even admin and marketing. This will be freeware, but the experience will be great.So, ideas anyone?
  6. Ok mate, there are a few things that you can do. As a few people have said, gargling salt water will do the trick, but if you do have real trouble, then it's best to go on "voice rest". Simply if you can, don't talk at all for a whole day, and then they will have recovered well enough to sing again.Also, DONT UNDER ANY CIRCUMSTANCES USE THROAT LOSENGERS!!! lol. That looks pretty aggressive, but it really is important. It soothes the pain, and conceals the damage that you are doing to your vocal chords. You'd be damaging them without realising it, so please for your own sake, stear clear.But, prvention is far better than cure, and if you warm up properly then you can avoid these kind of problems. Try the following warm -ups before you sing, and all will be gravey:i) Make a low, deep noise like a motorbike at the back of your throat for 10mins first thing in the morning (this will "shake" your vocal chords and get rid of all the gunk that may have formed overnight or whatever)ii) Make a high pitched crying noise like a sad dog (I know this sounds silly) and experiment with the entirity of your rangeiii) Then pretend that you've got something stuck to the roof of your mouth, and try to scrape it off with your tongue 10 times (this wont protect your voice, but will give you better diction)
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.