Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 13 Jan 2011
Offline Last Active Dec 12 2015 05:40 PM

#5015064 How easy is it to collaborate on a game remotely?

Posted by on 28 December 2012 - 07:50 AM

I would say that your question is to generic and by-far not relevant for you at this point in time.
If you are still learning c I would not go out and start thinking about things that might happen somewhere far out in the future.  Sure it is always good to think a couple steps ahead, but this is more like a few journeys that you still have ahead of you before even start thinking about things like this.
It is simple fact that focus will bring you far more result when undertaking something as learning how to develop games. Best what you could do if you are willing to think so far ahead is to make sure you at least have the necessary skills set. That will give you some insight about the basic ins en outs of the process involved that you are trying to collaborate on. Without that any project is doomed to fail even before it starts. 
IMO this question is wasted of time for you and for people on this form trying help you out. Any answer that you will get will probably raise more questions and than answers. The missing of a foundation makes it even harder to understand what every body in this thread is talking about.

The best advice I could give to you is stick with what you are trying to learn, keep thinking few steps ahead but not years unless your skills and experience allow you to.
Make a few games on your own before even start thinking to work with other people. There are not many teams that are willing to take on apprentices as they make chance of actually finishing a product very small.
Armed with the knowledge of the basic principles that are involved in making games and one or more skills that could be valuable to actually work with a team on a collaborative game project you would be able to ask much better question. You might be even able to answer this question for your self for the largest part.


#4989031 Virtual Coin Flip

Posted by on 11 October 2012 - 03:18 AM

Another solution might be using a recursive solution.

[source lang="java"]import java.util.Random;public class flip { static Random random_generator; static void flip_coin(int repeat) { if ( repeat > 0) { double random_number = random_generator.nextDouble(); System.out.println(random_number); if (random_number < 0.5) System.out.println("head"); else System.out.println("tail"); if(--repeat > 0) flip_coin(repeat); } } public static void main (String[] args) { random_generator = new Random(); flip_coin(10); }}[/source]

#4988364 "Getters" and "Setters" - do you write them if you don't...

Posted by on 09 October 2012 - 08:28 AM

First I will answer your question.
No you don't need to write setters and setter for every field in your class. Only if think you are going to use them or have the need for them to be public.
Making such decision is all up to you and is called software design. Use your logic to layout the classes in such way that they will work together but also will not cause problems behavior wise when you are able to modify properties publicly.

As for getters and setters them self. I have feel obligated to say they are not so great as every body might think. Actually they are even evil. First of all for the fact that most people never put anything in a getter setter block besideds passing true a value which is actually just mindless typing working which doesn't make sense at all.
Secondly for the fact that getters and setters are no more than syntax sugar in the end it is a function that return a fields value and set a value using function. With that said it more logical to make a function/method that has a better description about what the operation is going to preform on a class.

Compare the following example
[source lang="java"] spaceship = new SpaceShip(imgSpaceShip, posx, posy); if( spaceship.x < screen.width) spaceship.x += speed; if( spaceship.Y < screen.width) spaceship.y += speed;[/source]


[source lang="java"] spaceship = new SpaceShip(imgSpaceShip,posx,posy,speed); spaceship.move(screen);[/source]

This is a small part pseudo code that reflects real good what I mean that using getters and setters does not promote better software design. It is not even considered OOP.
I used to be a big fan off getters and setters until I starting using more languages that had no syntax sugar for getters and setters. At first it hated it then i found out that I wrote better OOP and made less mistakes due better open close principle and that methods attached to classes where better descriptions on them self. If you would still feel the need for model / object to have mainly public properties you might think of using a struct. Therefor I have to disagree with people in this thread whom claim that structs and classes are the same this is simple not true.