• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
ChristianFrantz

different way of learning

31 posts in this topic

I have 3 xna books and theyre each kicking my ass. I can't seem to get the material thru my brain no matter how many times I go over it. Are there any alternative ways to learning a language? Videos dont work for me either
0

Share this post


Link to post
Share on other sites
XNA isn't a language, its a library. If you want to learn c# there are live classes at 3dbuzz.com , as well as tutorials across the internet including video tutorials.

If books, tutorials and videos are not working for you, try knowledge suppositories. Edited by EddieV223
0

Share this post


Link to post
Share on other sites
You could try looking bits up in the [url="http://msdn.microsoft.com/en-us/library/ms123401.aspx"]MSDN[/url] as you run into them.
0

Share this post


Link to post
Share on other sites
For you? Or us? Don't forget. You're not the first person with these problems and you're not the last. So asking them and getting your questions answered is gonna help someone else in the long run.
0

Share this post


Link to post
Share on other sites
It seems unnecessary tho. I learn better when I figure things out by myself. I hate seeing code and then copying it word for word.
0

Share this post


Link to post
Share on other sites
I'm in complete agreement with Servant of the Lord - Google key words related to the concept. You'll usually hit an old post, blog, or tutorial discussing it.

It's not even to "copy working code" - You're bound to find the explanation written out somewhere. If you use the MSDN, you'll at least find a boring but accurate description of methods and their uses, too. The education catalog has pretty well-documented samples that explain what happens in each block and why it's necessary.

Programming is about understanding new concepts, not simply picking up a new command to use. It does take time and a lot of re-reading - Days or weeks in some cases. It happens to us all, and you might feel like you're not getting anywhere, but you will.

Since the thread is already up, do you want to post a couple examples of things that you're having trouble with? Edited by Haps
0

Share this post


Link to post
Share on other sites
The best way to learn is to do. C++ and SFML didn't click for me until I started writing my own code. I rigorously copied down the examples. The key here is to change the examples. Experiment with them. Look at, say, an images functions and try them all out. As you read constantly think about how you can apply this knowledge and you'll have it in no time. The only way to learn is to do.

The only way I'm learning good programming habits is to code. I'm slowly figuring out where to apply the single responsibility principle, how encapsulation should be implemented, good design patterns / principles, etc. The only way to actually understand a subject is to rigorously practice in the subject.
1

Share this post


Link to post
Share on other sites
alright i made this from scratch, but the paddles dont move. anyone know whats wrong?

[source lang="csharp"] protected override void Initialize()
{
// TODO: Add your initialization logic here

KeyboardState state = Keyboard.GetState();

if (state.IsKeyDown(Keys.Up))
{
paddle1Pos.Y -= 3;
}

if (state.IsKeyDown(Keys.Down))
{
paddle1Pos.Y += 3;
}

base.Initialize();
}

/// <summary>
/// LoadContent will be called once per game and is the place to load
/// all of your content.
/// </summary>
protected override void LoadContent()
{
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch(GraphicsDevice);

// TODO: use this.Content to load your game content here
ball = Content.Load<Texture2D>("ball");
paddle = Content.Load<Texture2D>("paddle");
}

/// <summary>
/// UnloadContent will be called once per game and is the place to unload
/// all content.
/// </summary>
protected override void UnloadContent()
{
// TODO: Unload any non ContentManager content here
}

/// <summary>
/// Allows the game to run logic such as updating the world,
/// checking for collisions, gathering input, and playing audio.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Update(GameTime gameTime)
{
int minY = 0;
int minX = 0;
int maxY = 600 - ball.Height;
int maxX = 1000 - ball.Width;

// Allows the game to exit
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
this.Exit();

// TODO: Add your update logic here

ballPos += ballSpeed * (float)gameTime.ElapsedGameTime.TotalSeconds;

if (ballPos.X > maxX)
{
ballPos.X = maxX;
ballSpeed.X *= -1;
}

if (ballPos.X < minX)
{
ballSpeed.X *= -1;
ballPos.X = minX;
}

if (ballPos.Y < minY)
{
ballPos.Y = minY;
ballSpeed.Y *= -1;
}

if (ballPos.Y > maxY)
{
ballPos.Y = maxY;
ballSpeed.Y *= -1;
}

Rectangle paddle1Rect = new Rectangle((int)paddle1Pos.X, (int)paddle1Pos.Y, paddle.Width, paddle.Height);
Rectangle ballRect = new Rectangle((int)ballPos.X, (int)ballPos.Y, ball.Width, ball.Height);

if (ballRect.Intersects(paddle1Rect))
{
ballSpeed *= -1;
}

base.Update(gameTime);
}

/// <summary>
/// This is called when the game should draw itself.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.White);

// TODO: Add your drawing code here
spriteBatch.Begin();

spriteBatch.Draw(paddle, paddle1Pos, Color.White);
spriteBatch.Draw(ball, ballPos, Color.White);

spriteBatch.End();
base.Draw(gameTime);
}
}
}
[/source]
1

Share this post


Link to post
Share on other sites
You put your keyboard polling within Initialize. Initialize is not called every frame, you would want that in Update.
1

Share this post


Link to post
Share on other sites
If I had to guess, I would say it is because the code for moving the paddles is located inside Initialize(), which is only called once (I would hope, otherwise it needs a new name).


[EDIT]
I idled for a while before replying.
[/EDIT]


L. Spiro Edited by L. Spiro
2

Share this post


Link to post
Share on other sites
Another chance to post my famous list. Hold, please.

EDIT: Here we go.
[list=1]
[*]Pong
[*]Breakout
[*]Space Invaders (credit to GearSlayer360)
[*]Missile Command
[*]Asteroids
[*]Tetris
[*]Pac-Man
[*]Tic-Tac-Toe (credit to 3Ddreamer)
[*]????
[*]Make Money
[/list]
The reason for this list is because you know how these games work. The rules and how all the parts are supposed to work. So it's easy to go down the list and learn new skills as you complete each game. For a really good tutorial on 2D game development, google for Lazy Foo SDL Edited by Alpha_ProgDes
1

Share this post


Link to post
Share on other sites
breakout is easy enough. i made that in java and C++. i tried snake after that but failed :( space invaders would be a challenge because you have the shields that protect you from enemy bullets, and a whole array of enemies that move together. and lets not forget the actual process of shooting a bullet which i never understood
0

Share this post


Link to post
Share on other sites
[quote name='burnt_casadilla' timestamp='1351581584' post='4995317']
and lets not forget the actual process of shooting a bullet which i never understood
[/quote]

I don't consider this a programing or api knowledge problem. I see this as an imagination problem. It's just like a puzzle, but harder one. You have certain elements( types like float, int, in xna case also Vectors, containers like lists, you can create your own classes and structers), only thing is to think of how to combine this pieces of puzzle into whole.

As I always suggest, piece of paper is your best friend. Draw your problem (in case of shooting you got a plane/vehicle and a bullet). Write what defines a plane and what defines a bullet(position, velocity etc.). Draw some vectors (for instance, from plane in shoting direction). Search for relations, experiment. If you won't try you won't accomplish a thing :)

The most importan thing of all is to never give up :)
I learned basics of xna from [url="http://rbwhitaker.wikidot.com/xna-tutorials"]http://rbwhitaker.wikidot.com/xna-tutorials[/url] , maybe it will help you too ;)
2

Share this post


Link to post
Share on other sites
[quote name='burnt_casadilla' timestamp='1351577925' post='4995305']
I managed to make a pong game but with no ai. Where do i go from there?
[/quote]
But the comment above initialise would have when the game1.cs file is generated. Have a look at the comments above the functions in the main game class after creating a new XNA game from the wizards. They say when and how often they are executed also the //TODO comments kind mention what you should do in them.
0

Share this post


Link to post
Share on other sites
the only thing i could think of is creating an array for storing bullets, lets say there can be 10 on the screen at a time. and whenever spacebar is pressed, create a bullet at shipPos.X and shipPos.Y, and send the bullet straight up by subracting its y value.

i guess my problem is that i really only know one side to doing things. I have a hard time thinking of different ways to program if my first option doesnt work because I get stuck in a loop trying to fix something that might not even work at all Edited by burnt_casadilla
0

Share this post


Link to post
Share on other sites
[quote name='burnt_casadilla' timestamp='1351617301' post='4995487']
the only thing i could think of is creating an array for storing bullets, lets say there can be 10 on the screen at a time. and whenever spacebar is pressed, create a bullet at shipPos.X and shipPos.Y, and send the bullet straight up by subracting its y value.

i guess my problem is that i really only know one side to doing things. I have a hard time thinking of different ways to program if my first option doesnt work because I get stuck in a loop trying to fix something that might not even work at all
[/quote]
That'll work just fine. Just keep checking it for collisions and when it goes outside of the playing area (screen) remove it from the array (This could be done using null). Making it possible to shoot another bullet. Edited by Slushy
0

Share this post


Link to post
Share on other sites
I don't even know where to start with the code for this. So far I have
[source lang="csharp"]Texture2D ship, bullet, alien;

Texture2D[] aliens = new Texture2D[20];
Texture2D[] bullets = new Texture2D[10];

Vector2 shipPos = new Vector2(200, 540);
Vector2 alienPos = new Vector2(200, 400);
Vector2 bulletPos = new Vector2(200, 450);

Vector2[] aliensPos = new Vector2[20];
Vector2[] bulletsPos = new Vector2[10];

int alienCount = 0;
int bulletCount = 0;

KeyboardState state = Keyboard.GetState();

public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";

graphics.PreferredBackBufferWidth = 400;
graphics.PreferredBackBufferHeight = 600;
}

protected override void Initialize()
{
base.Initialize();
}

protected override void LoadContent()
{
spriteBatch = new SpriteBatch(GraphicsDevice);

alien = Content.Load<Texture2D>("alien");
bullet = Content.Load<Texture2D>("bullet");
ship = Content.Load<Texture2D>("ship");

for (int x = 0; x < 5; x++)
{
for (int y = 0; y < 4; y++)
{
aliens[alienCount] = Content.Load<Texture2D>("alien");
aliensPos[alienCount].X = 100 + (x * 40);
aliensPos[alienCount].Y = 20 + (y * 40);
alienCount++;
}
}
}

protected override void UnloadContent()
{

}

protected override void Update(GameTime gameTime)
{
if (state.IsKeyDown(Keys.Right) && shipPos.X < 360)
{
shipPos.X += 5;
}

if (state.IsKeyDown(Keys.Left) && shipPos.X > 0)
{
shipPos.X -= 5;
}

if (state.IsKeyDown(Keys.Space))
{

}

base.Update(gameTime);
}

protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.Black);

spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend);

spriteBatch.Draw(ship, shipPos, Color.White);
spriteBatch.Draw(bullet, bulletPos, Color.White);
spriteBatch.Draw(alien, alienPos, Color.White);

for (int alienCount = 0; alienCount < 20; alienCount++)
{
spriteBatch.Draw(aliens[alienCount], aliensPos[alienCount], Color.White);
}

spriteBatch.End();
base.Draw(gameTime);
}
}
}
[/source]

I know that the update method runs 60 times a second, so that would create more bullets than I need per each press of the spacebar. And I have no idea how to get the position of the ship and how to create a bullet there
0

Share this post


Link to post
Share on other sites
You can use a variable in conjunction with gameTime.ElapsedTime to make a cooldown on how often the bullet actually gets fired.

ShipPos.X and ShipPos.Y are keeping track of your ship's position. When you make a new bullet, relate it to those coordinates.
0

Share this post


Link to post
Share on other sites
so something like this?
[source lang="csharp"] if (state.IsKeyDown(Keys.Space))
{
for (int i = 0; i < 10; i++)
{
bullets[bulletCount] = Content.Load<Texture2D>("bullet");
bulletsPos[bulletCount].X = shipPos.X;
bulletsPos[bulletCount].Y = shipPos.Y;
bulletCount++;
}
}[/source]
[source lang="java"] for (int bulletCount = 0; bulletCount < 10; bulletCount++)
{
spriteBatch.Draw(bullets[bulletCount], bulletsPos[bulletCount], Color.White);
}
[/source]

i try this and it says texture does not expect null Edited by burnt_casadilla
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0