Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

David.M

Member Since 17 Aug 2011
Online Last Active Today, 11:15 AM
-----

#5058287 What programming language should i go with? (C++,C# or java?)

Posted by David.M on 01 May 2013 - 07:02 AM

This would fit better in the For Beginners section. To answer your question, use whichever language you want. This article  talks about C++, Java, C#, and Python. If you don't like using Java then you really won't want to learn game programming in Java because you'll get bored and discouraged. Pick whichever language you want and start game programming in it. As a beginner there is no "best choice" really.




#5058239 Beginner questions

Posted by David.M on 30 April 2013 - 09:54 PM

Allow me to point you to this link. This will discuss C++, Java, C#, and Python as options for a beginning developer. As 0r0d said, start with what you know. I would choose C# or Java since you said you know both. Take a look at the options for each language and see which you find easier to use or better to work with and get programming with it.




#5057131 Which language to start with?

Posted by David.M on 26 April 2013 - 08:40 PM

If you read through those billion topics you mentioned, you'll find that this link will help you out a lot. That should explain everything better than I can. In short, it doesn't really matter what language you pick so long as you pick a language and start programming.




#5034846 [JAVA]First Game help[JAVA]

Posted by David.M on 20 February 2013 - 09:02 PM

I would change y += 1 to y += ballVelocity. ballVelocity would then initially be 1. If the ball's y position is > the screen's height or is < 0, reverse ballVelocity.




#4970527 Beginner doubts

Posted by David.M on 17 August 2012 - 07:05 AM

Before you can make an FPS game you have to learn the basics of the language. From there you can make simple games. Then, eventually, you'll be able to work your way up to creating more complex games. This is a good read to get you started.


#4970517 Help Planning for a Beginner, Wall of text

Posted by David.M on 17 August 2012 - 06:11 AM

C++ is regarded as being the "best" language for game development because that's what AAA game studios use. They really have to use C++ though because speed is critical in those situations. For an indie game and just starting out, this isn't necessary. You'll be able to make good games in whatever language you want. XNA is a good choice. I think a lot of people here on GameDev use C# and XNA. With Java you can use Slick2D (Obviously for 2D), LibGDX, LWJGL, jMonkeyEngine, or a couple others. C++ has a lot of resources available. However, C++ is also the most difficult to work with. I think XNA would be a good start. This will allow you to become familiar with game development. You will be able to apply these skills to any language so if you later decide you need C++ you will be able to use the same skills you learned with XNA.

If you think about it, a game really is just an animation that a user has a part in controlling.

These forums are a great resource for getting started. Good luck!


#4970434 Help Planning for a Beginner, Wall of text

Posted by David.M on 16 August 2012 - 11:19 PM

1. They have different controls and different styles but they all essentially run the same way: Gather Input > update according to input > render. Modifying gravity in Tetris is as simple as modifying a gravity variable which is used each update to move blocks down. You're not always going to render at the same framerate. Depending on the machine your framerate will be different. That's why the delta variable is used in movement. It takes the amount of time since the last frame was drawn and uses this to update.

2. A sprite is really just a name. You could just as easily call it an entity or any other arbitrary assignment. I haven't done 3D programming or modeling so I can't say what file formats are used. Culling and clipping will take place in the graphics engine.

3. Around here you'll be advised not to write your own engine. This will take a long time and you're almost guaranteed somebody else has done it better (like a big company). Graphics, I/O, sound, and input are all necessary. What you use will depend on your language and style.

4. I've never done any scripting. From what I've heard, Unity uses scripting quite a bit.

5. Start small. Start simple. Tic-tac-toe is small and simple. From there you can branch into more complex console stuff, then jump into graphics, again starting small. Pong, Snake, Space Invaders. I don't think turn-based games would be any easier than platform games. You still gather and process input and render the same way. You can jump into 3D if you want but the learning curve will be steeper.

This is a good read. What book to get depends on what language you want. If you like C# then use C#. If you like C++ use C++. If you like Java use Java. If you like Python use Python. It's up to you. Whatever you know best and are most comfortable with will allow you to learn game development which can be applied to other languages.


#4970344 Java Slick - Number of States

Posted by David.M on 16 August 2012 - 03:27 PM

Welcome to the joys of game programming! The community here and on the slick forums are great  places to ask questions.

1. The only limitations to the number of states you can have is the max for the data type you use. You won't ever overflow an int with states.

2. Whatever helps you organize and work better is what you should be doing. If you use a lot of classes and packages and it helps you stay organized and works well then by all means use a lot.

3. You can. These will be useful in superclasses (Sprite or Entity that can be extended). If you have to you can even use classes with static members such as an Assets class.

4. I'm not sure what you mean. Why would you need to show multiple states? If you want to display some text when you hover over an item you can do that programmatically in each state individually with no problem.


#4969999 Fading Objects In And Out

Posted by David.M on 15 August 2012 - 05:59 PM

Change the color you use. Start out with a color that is mostly (or all) transparent (low alpha) then raise the alpha over time to 255 (fully opaque).

Edit: Thanks BeerNutts. Had it backwards.


#4968863 collision with fillOval

Posted by David.M on 12 August 2012 - 04:24 PM

Any special reason for having both a width and height? If it's a circle those are the same so you can have just one field, radius, to cover width and height.

To your Ball class you can add getX(), getY(), and getRadius() methods.

ArrayList<Ball> balls = new ArrayList<Ball>();

ballPositionX = balls.get(0).getX(); // gets the first ball's x position
ballPositionY = balls.get(0).getY(); //gets the first ball's y position
ballRadius = balls.get(0).getRadius(); //gets the first ball's radius

Then, circle collision detection is easy. Take two balls. Grab the x and y positions (centers) of both of them. If those positions are within (<) ball1.radius + ball2.radius then they are colliding.


#4968853 collision with fillOval

Posted by David.M on 12 August 2012 - 04:03 PM

If you want to make a ball at some random position I would do something like the below.

ArrayList<Ball> balls = new ArrayList<Ball>();
//Option 1: return a ball to be added like balls.add(makeBall());
private Ball makeBall()
{
	 Random rand = new Random();
	 Ball newBall = new Ball();
	 newBall.x = rand.nextFloat() * FRUSTUM_WIDTH;
	 newBall.y = rand.nextFloat() * FRUSTUM_HEIGHT;
	 newBall.radius = rand.nextFloat() * MAX_RADIUS;
	 return newBall;
}

//Option 2: add the ball to the list inside the method
private void newBall()
{
	 Random rand = new Random();
	 balls.add(new Ball(rand.nextFloat() * FRUSTUM_WIDTH, rand.nextFloat() * FRUSTUM_HEIGHT,
		  rand.nextFloat() * MAX_RADIUS));
}

This would have a ball class which stores an x and y position and a radius. The list will store all the balls and be looped through to update and render the balls. Option 1 has a blank constructor and the fields (x, y, radius) must be initialized manually. Option 2 has a constructor public Ball(float xPosition, float yPosition, float radius).

Edit: Then you would call this
for(int i = 0; i < balls.size(); i++)
{
	 float x = balls.get(i).getX();
	 float y = balls.get(i).getY();
	 //check collisions here
}



#4968732 collision with fillOval

Posted by David.M on 12 August 2012 - 09:18 AM

You don't need a set point to test against. You should be keeping track of the x and y position of the object so you just need to check if one side is inside another. If the left side of one rectangle is inside another rectangle its (position - width) will be less than the other rectangle's right edge and greater than its left. This can easily be applied to the other sides.

Rectangle to Rectangle you can use Rectangle.intersects().


#4968611 collision with fillOval

Posted by David.M on 11 August 2012 - 09:39 PM

If you have a small enough circle or accuracy isn't an issue you can assign bounding rectangles. Otherwise I would check the bounds against circle.x + radius, circle.x - radius, circle.y + radius, and circle.y - radius.


#4965771 what are the best android game development tutorial websites

Posted by David.M on 03 August 2012 - 12:56 AM

The Official Android Developer page would be a great start. If you don't know Java you'll want to learn it. You can use a canvas to draw your game using the CPU or you can use OpenGL ES 1.x or 2.0. If you don't want to mess with OpenGL then check out frameworks and engines available. I've been using LibGDX which abstracts away the OpenGL and allows you to develop for Windows/Linux/Mac, Android, and the web simultaneously. I've never used it but AndEngine is an Engine if you prefer that over a framework. There is also Unity if you want to use C# and script your games.


#4964211 2D game for Android?

Posted by David.M on 29 July 2012 - 01:08 AM

If you're going to do Android programming you'll probably want to learn Java. I believe you can do Android programming in C++ but you won't want to start out with C++. I don't know why you were suggested to learn Python if you're going to do Android programming. C# is also a possibility if you use Unity for Android.

I would recommend learning Java. Check out the Android Developer site to get started in Android programming. After you have a pretty good grasp on Java you can start Android game programming. If you want a framework to go on so you don't have to handle all the OpenGL ES yourself check out AndEngine and LibGDX. Personally, I've started using LibGDX and it's abstraction of OpenGL seems very nice. It allows you to develop games for Windows/Mac/Linux, Android, and the web though a single project.




PARTNERS