Coding/Programming

Talk about computers, hardware, applications, and consumer electronics.
User avatar
The number of seats in an Airbus A380
Posts: 558
Joined: 2008.11.13 (01:45)
NUMA Profile: http://nmaps.net/user/slayr
Location: Southern Ontario
Contact:

Postby Slayr » 2010.06.24 (14:35)

I recently watched a video that mentioned that you can create your own Xbox indie games using XNA studio and Microsoft Visual C# Express, so I downloaded both and then realized that I had no idea what any of the stuff on the screen meant. I thought that maybe some of you know some coding for Visual C# and would like your help.

User avatar
Not So Awesome Blossom
Posts: 2529
Joined: 2008.09.26 (21:28)
NUMA Profile: http://nmaps.net/user/
Steam: www.steamcommunity.com/id/
Location: USA

Postby Vyacheslav » 2010.06.24 (15:31)

I haven't got a clue about coding and programming, but my bet is that it would require a lot of knowledge of C and XNA to be able to compile a game.
Image

User avatar
Average Time to Take Breakfast in Equador
Posts: 640
Joined: 2008.09.27 (03:11)
NUMA Profile: http://nmaps.net/user/geti
MBTI Type: ENFJ
Contact:

Postby Geti » 2010.06.24 (20:11)

To compile a game, no. To compile a good game, yes, as well as a good knowledge of game design and decent assets.
I'd suggest you start with a more user friendly language (though C# isn't that bad) like Lua or Python to get the hang of logic flow etc, but it'll take you quite a while to get to a point where you can actually make decent games.
Some people suggest starting with non-code oriented game making packages, like gamemaker and the like, but I think that'll only take you so far. Some amazing games have been made with gamemaker, but many more sub-par ones have been, especially with the non-paid version. Sure, something to consider, but I think going straight to code of some sort is a better idea if that's your end goal.
I started by using game oriented libs/frameworks (and technically I still am using them :P I got sick of writing and rewriting collision logic while I was prototyping, but I'll get intimate with C++ again someday I suppose.), and XNA is one of these, however you might want to start with something that'd be easier to learn. I can say from personal experience that Love is a great place to start learning the outs of coding without having to worry to much about the ins (instead of blitting something to the screen, you just call love.draw(thing,x,y), or if you've got it set up correctly thing:draw()) which basically means you can make games more quickly. Then, once you're comfortable with that, you move on to something a little more in-depth.
This is all just one possible path, it's entirely possible to jump straight into XNA and C# and go "make some games", but you're very likely to get swamped if you've never coded before.
spoiler

"I'd be happy for a lion if it hunted me down and ate me, but not so happy for it if it locked up me and my family, then forced us to breed so it may devour our offspring." - entwilight <3
How do you know that God didn't intend for humans to be the animals' caretakers? He might be appalled that He gave us these animals to use and we're fucking eating them. - Tsukatu
4th - DDA Speedrunning Contest.
One Hundred Percent Vegetarian

deviantArt Profile - 1BarDesign
God knows if i'm back.

User avatar
The number of seats in an Airbus A380
Posts: 558
Joined: 2008.11.13 (01:45)
NUMA Profile: http://nmaps.net/user/slayr
Location: Southern Ontario
Contact:

Postby Slayr » 2010.06.24 (21:11)

Thanks for all the advice, but when i downloaded Love it wouldn't let me open it and then i downloaded Lua but it told me it didn't know how to open it

User avatar
Retrofuturist
Posts: 3131
Joined: 2008.09.19 (06:55)
MBTI Type: ENTP
Location: California, USA
Contact:

Postby t̷s͢uk̕a͡t͜ư » 2010.06.25 (08:23)

Slayr wrote:Thanks for all the advice, but when i downloaded Love it wouldn't let me open it and then i downloaded Lua but it told me it didn't know how to open it
Yeah, that* pretty much means that you're fucked for life on the programming. It's not for everyone. Better luck next time.

*namely your seeming inability to Google and/or RTFM, because that's a huuuuge part of being a successful programmer
[spoiler="you know i always joked that it would be scary as hell to run into DMX in a dark ally, but secretly when i say 'DMX' i really mean 'Tsukatu'." -kai]"... and when i say 'scary as hell' i really mean 'tight pink shirt'." -kai[/spoiler][/i]
spoiler

Image


User avatar
The number of seats in an Airbus A380
Posts: 558
Joined: 2008.11.13 (01:45)
NUMA Profile: http://nmaps.net/user/slayr
Location: Southern Ontario
Contact:

Postby Slayr » 2010.06.27 (16:54)

Tsukatu wrote: *namely your seeming inability to Google and/or RTFM, because that's a huuuuge part of being a successful programmer
Touché. I'm getting a book about coding in C sharp '08 today from Chapters. Hopefully this will help.

User avatar
The number of seats in an Airbus A380
Posts: 558
Joined: 2008.11.13 (01:45)
NUMA Profile: http://nmaps.net/user/slayr
Location: Southern Ontario
Contact:

Postby Slayr » 2010.06.28 (16:12)

i got 2 books yesterday one about C# '08 and one about programming with Python.

So far in Visual Studio I've gotten a program to create a black box that prompts you to enter a name and then says Hello .... then tells you to press enter, when you do it closes.

Yes sir, no sir, three bags full sir
Posts: 1561
Joined: 2008.09.26 (12:33)
NUMA Profile: http://nmaps.net/user/incluye
MBTI Type: ENTP
Location: USofA
Contact:

Postby otters » 2010.06.28 (17:37)

Just learn the basics first. I guess your first program counts, but you need to know the fundamentals of programming before you can make big stuff.

Also, I've known most books to be vigorously lame, whereas teaching yourself--and using the internet for help, and maybe even Freenode if your asshole defenses are high--gives you a better understanding of what you actually need to know rather than what the author told you.
Image

User avatar
The number of seats in an Airbus A380
Posts: 558
Joined: 2008.11.13 (01:45)
NUMA Profile: http://nmaps.net/user/slayr
Location: Southern Ontario
Contact:

Postby Slayr » 2010.06.30 (19:02)

hey, I'm like a quarter of the way through making a 2D game and I got an error so I looked at the help page which made no sense so I looked it up and didn't find anything of useso I was wondering if you guys could help "translate" it.
The type or namespace name 'type/namespace' could not be found (are you missing a using directive or an assembly reference?)

A type was not found. You may have forgotten to reference (/reference) the assembly that contains the type or you may not have correctly qualified its use with the using directive.

There are several reasons for this error:

The name of the type or namespace you are trying to use may be misspelled (including the correct case). Without the correct name the compiler is unable to find the definition for the type or namespace you have referred to in your code. This occurs most often because C# is case-sensitive and the correct casing has not been used when referring to the type. For example, Dataset ds; will generate CS0246; notice the s in Dataset is not capitalized.
If the error is for a namespace name, you may not have referenced (/reference) the assembly containing the namespace. For example, your code might contain using Accessibility;. However, if your project doesn't reference the assembly Accessibility.dll then you will get CS0246. See the Add Reference Dialog Box for information on how to reference an assembly in the development environment.
See Add Reference Dialog Box for information on how to add a reference in the development environment.

If the error is for a type name, you may not have the proper using directive, or you have not fully qualified the name of the type. Consider the following line of code: DataSet ds;. To be able to use the DataSet type you would need to do two things. First, you need a reference to the assembly that contains the definition for the DataSet type. Second, you need a using directive for the namespace where DataSet is located. For example, because DataSet is located in the System.Data namespace, you would need the following statement at the beginning of your code: using System.Data;.
The second step is not required. However, if you omitted this step then it would require that you fully qualify the DataSet type when referring to it. Fully qualifying it means that you use the namespace and type each time you refer to it in your code. So, if you decided to skip the second step you would need to change your declaration code above to: System.Data.DataSet ds;.

User avatar
Lifer
Posts: 1099
Joined: 2008.09.26 (21:35)
NUMA Profile: http://nmaps.net/user/smartalco
MBTI Type: INTJ

Postby smartalco » 2010.06.30 (19:34)

Some source code would help. Pastebin it and link it here.
Image
Tycho: "I don't know why people ever, ever try to stop nerds from doing things. It's really the most incredible waste of time."
Adam Savage: "I reject your reality and substitute my own!"

User avatar
The number of seats in an Airbus A380
Posts: 558
Joined: 2008.11.13 (01:45)
NUMA Profile: http://nmaps.net/user/slayr
Location: Southern Ontario
Contact:

Postby Slayr » 2010.06.30 (19:45)

what code do you want? the code it has issues with? because that is
GameObject cannon;

the whole thing is a little is here: http://pastebin.com/5AVCZ5SQ

User avatar
Retrofuturist
Posts: 3131
Joined: 2008.09.19 (06:55)
MBTI Type: ENTP
Location: California, USA
Contact:

Postby t̷s͢uk̕a͡t͜ư » 2010.06.30 (22:09)

A line number for the error message would be helpful, although I'm going to venture a guess that it's choking on one of your variable declarations. You've attempted to include a whole lot of Microsoft.Xna.Framework packages -- maybe these are improperly installed and the linker can't find them, which would cause it to choke on the attempt to use a type declared therein.
[spoiler="you know i always joked that it would be scary as hell to run into DMX in a dark ally, but secretly when i say 'DMX' i really mean 'Tsukatu'." -kai]"... and when i say 'scary as hell' i really mean 'tight pink shirt'." -kai[/spoiler][/i]
spoiler

Image


User avatar
The number of seats in an Airbus A380
Posts: 558
Joined: 2008.11.13 (01:45)
NUMA Profile: http://nmaps.net/user/slayr
Location: Southern Ontario
Contact:

Postby Slayr » 2010.06.30 (22:21)

the error is on line 26 (GameObject cannon;) it's right near the top.
and all the stuff about microsoft xna is all installed properly.
I'm using a template adding to Visual Studio by XNA game studio.

User avatar
Retrofuturist
Posts: 3131
Joined: 2008.09.19 (06:55)
MBTI Type: ENTP
Location: California, USA
Contact:

Postby t̷s͢uk̕a͡t͜ư » 2010.06.30 (22:57)

The only other thing I can think of is that you're missing a "using" statement. It's certainly possible that the template you used neglected to include the one containing the "GameObject" type.
This is normally the point where I'd go to my include directory and grep for "GameObject" to see where it's actually defined, but I'm not entirely sure what the equivalent of that would be (a) for C# libraries (b) in a Windows environment. Did those libraries come with documentation? Scour it for references to GameObject.
[spoiler="you know i always joked that it would be scary as hell to run into DMX in a dark ally, but secretly when i say 'DMX' i really mean 'Tsukatu'." -kai]"... and when i say 'scary as hell' i really mean 'tight pink shirt'." -kai[/spoiler][/i]
spoiler

Image


User avatar
The number of seats in an Airbus A380
Posts: 558
Joined: 2008.11.13 (01:45)
NUMA Profile: http://nmaps.net/user/slayr
Location: Southern Ontario
Contact:

Postby Slayr » 2010.07.01 (01:45)

would this be where it is defined?

class GameObject
{
public Texture2D sprite;
public Vector2 position;
public float rotation;
public Vector2 center;

public GameObject(Texture2D loadedTexture)
{
rotation = 0.0f;
position = Vector2.Zero;
sprite = loadedTexture;
center = new Vector2(sprite.Width / 2, sprite.Height / 2);

User avatar
Retrofuturist
Posts: 3131
Joined: 2008.09.19 (06:55)
MBTI Type: ENTP
Location: California, USA
Contact:

Postby t̷s͢uk̕a͡t͜ư » 2010.07.01 (03:37)

Slayr wrote:would this be where it is defined?

class GameObject
{
public Texture2D sprite;
public Vector2 position;
public float rotation;
public Vector2 center;

public GameObject(Texture2D loadedTexture)
{
rotation = 0.0f;
position = Vector2.Zero;
sprite = loadedTexture;
center = new Vector2(sprite.Width / 2, sprite.Height / 2);
YES.
Make sure that library is included in your "using" statements.
[spoiler="you know i always joked that it would be scary as hell to run into DMX in a dark ally, but secretly when i say 'DMX' i really mean 'Tsukatu'." -kai]"... and when i say 'scary as hell' i really mean 'tight pink shirt'." -kai[/spoiler][/i]
spoiler

Image


Beyond a Perfect Math Score
Posts: 829
Joined: 2008.09.25 (21:35)
Location: England
Contact:

Postby Luminaflare » 2010.07.01 (14:02)

I'd just like to congratulate you on not being one of the shambling masses that read you can code video games and decided you should just be able to do it. You looked up what you needed and you're actually learning it, keep going and you get a medal.

User avatar
Not So Awesome Blossom
Posts: 2529
Joined: 2008.09.26 (21:28)
NUMA Profile: http://nmaps.net/user/
Steam: www.steamcommunity.com/id/
Location: USA

Postby Vyacheslav » 2010.07.01 (14:09)

Luminaflare wrote:I'd just like to congratulate you on not being one of the shambling masses that read you can code video games and decided you should just be able to do it. You looked up what you needed and you're actually learning it, keep going and you get a medal.
What he said. Deadly-vu.
Image

User avatar
The number of seats in an Airbus A380
Posts: 558
Joined: 2008.11.13 (01:45)
NUMA Profile: http://nmaps.net/user/slayr
Location: Southern Ontario
Contact:

Postby Slayr » 2010.07.01 (15:54)

I live with a lot of sarcastic people so I'm never really sure when someone is being sarcastic. I usually assume but if you're not then thanks!

EDIT: and Tsukatu I don't know what you mean by "using" statements, and don't blame me for not trying I just read a 7 880 word document I downloaded from dummies.com because the book said it would deal with "The whole business of namespaces and using..."
So could you kindly explain.

User avatar
Retrofuturist
Posts: 3131
Joined: 2008.09.19 (06:55)
MBTI Type: ENTP
Location: California, USA
Contact:

Postby t̷s͢uk̕a͡t͜ư » 2010.07.01 (18:52)

Slayr wrote:Tsukatu I don't know what you mean by "using" statements, and don't blame me for not trying I just read a 7 880 word document I downloaded from dummies.com because the book said it would deal with "The whole business of namespaces and using..."
So could you kindly explain.
At the top of the code that you posted on pastebin, you have something like:

Code: Select all

using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;
These are the "using" statements I was referring to (note that they are statements and that their function revolves around the keyword "using").
Whatever file or library or package or whatever you found the definition of GameObject in, make sure that that package is being included through these "using" statements.
[spoiler="you know i always joked that it would be scary as hell to run into DMX in a dark ally, but secretly when i say 'DMX' i really mean 'Tsukatu'." -kai]"... and when i say 'scary as hell' i really mean 'tight pink shirt'." -kai[/spoiler][/i]
spoiler

Image


User avatar
The number of seats in an Airbus A380
Posts: 558
Joined: 2008.11.13 (01:45)
NUMA Profile: http://nmaps.net/user/slayr
Location: Southern Ontario
Contact:

Postby Slayr » 2010.07.01 (19:35)

so should I put in
using GameObject;
or
using GameObject.cs;
and the tutorial i'm watching to make this game is slowly increasing the amount of errors. I am now up to 17 errors and i'm doing exactly what this guy is telling me to do.

User avatar
Retrofuturist
Posts: 3131
Joined: 2008.09.19 (06:55)
MBTI Type: ENTP
Location: California, USA
Contact:

Postby t̷s͢uk̕a͡t͜ư » 2010.07.01 (20:55)

Slayr wrote:so should I put in
using GameObject;
or
using GameObject.cs;
and the tutorial i'm watching to make this game is slowly increasing the amount of errors. I am now up to 17 errors and i'm doing exactly what this guy is telling me to do.
No, the "using" statement would have to do with the namespace it's in.
I'm going to be terse here because I'm not interested in teaching you anything in this thread:
Go back to the file where you found the definition you posted above for the GameObject. Look for the curly brackets that enclose it and find the label for that namespace. This is the name that the "using" keyword would be looking for.

For example, if the package looked like this:

Code: Select all

namespace GameComponents
{
    // ...
    class GameObject
    {
        // blah blah blah
    }
    // ...
}
...and if it was in the Microsoft.Xna.Framework package (which can probably be determined in the directory hierarchy of the file that includes the above code, then you would need using Microsoft.Xna.Framework.GameComponents; in your code in order to use the GameObject class.
[spoiler="you know i always joked that it would be scary as hell to run into DMX in a dark ally, but secretly when i say 'DMX' i really mean 'Tsukatu'." -kai]"... and when i say 'scary as hell' i really mean 'tight pink shirt'." -kai[/spoiler][/i]
spoiler

Image


User avatar
The number of seats in an Airbus A380
Posts: 558
Joined: 2008.11.13 (01:45)
NUMA Profile: http://nmaps.net/user/slayr
Location: Southern Ontario
Contact:

Postby Slayr » 2010.07.01 (23:58)

this code?
namespace WindowsGame1
{
class GameObject
{
public Texture2D sprite;
public Vector2 position;
public float rotation;
public Vector2 center;

public GameObject(Texture2D loadedTexture)
{
rotation = 0.0f;
position = Vector2.Zero;
sprite = loadedTexture;
center = new Vector2(sprite.Width / 2, sprite.Height / 2);
}
}
}

So would it be Microsoft.Xna.Framework.WindowsGame1?

User avatar
The number of seats in an Airbus A380
Posts: 558
Joined: 2008.11.13 (01:45)
NUMA Profile: http://nmaps.net/user/slayr
Location: Southern Ontario
Contact:

Postby Slayr » 2010.07.02 (00:04)

I FIXED IT!!!!
thank you soooo much Tsukatu this has been frustrating me for days!!!
now i just have to fix the 12 other errors.

EDIT: solved all the errors and now have a rotating cannon and a background.


Who is online

Users browsing this forum: No registered users and 11 guests