[QUOTE=Xion12;30324539]It works but then the sprite starts glitching out and flying up :v:. Thanks a lot, I'll work on fixing this thing.[/QUOTE]
I have tried it my self, just wrote a little different ball class.
[code]public class Ball
{
private Vector2 Pos;
private Vector2 Vel;
private Rectangle CollBox;
private Texture2D Texture;
public Ball(Texture2D Texture, Vector2 Pos, Vector2 Vel, Rectangle CollBox)
{
this.Texture = Texture;
this.Pos = Pos;
this.Vel = Vel;
this.CollBox = CollBox;
}
public void Update( float ft )
{
Vel.Y += 40f * (ft / 1000f);
Pos += Vel;
if (Pos.X >= CollBox.Width || Pos.X <= 0)
Vel.X = -Vel.X;
if (Pos.Y >= CollBox.Height || Pos.Y <= 0)
Vel.Y = -Vel.Y;
}
public void Draw(SpriteBatch b)
{
b.Draw(Texture, Pos, Color.White);
}
}[/code]
[code]Creation: ball = new Ball(BallTextute, new Vector2(50, 50), new Vector2(5, 5), new Rectangle(0, 0, 1280, 720));
Drawing: ball.Draw(spriteBatch);
Updating: ball.Update(gameTime.ElapsedGameTime.Milliseconds);[/code]
Works flawlessly. Until it falls thru the ground :v:
[QUOTE=Fox-Face;30317818]EDIT: Nevermind, seems like classes are passed by reference in .NET[/QUOTE]
classes are ref types, structs are value types
[editline]8th June 2011[/editline]
[QUOTE=laharlsblade;30315302]I'm taking a comp sci class[/quote]
since when is flash comp sci
[quote]cs5[/QUOTE]
heh
I am quite confused right now - I've been running all my shaders as GLSL 330, and now that I just used GL.GetString, I see that it's returning OpenGL 2.1.2 and GLSL 120 for my GTX260.
I'm assuming there was a driver update that let me use OpenGL 3.3 functionality, but GetString doesn't reflect that, so my attempts at writing a small script file that will let me fall back to older shaders if the new ones aren't supported won't work all that well...
So how would I accurately detect the latest supported OpenGL/GLSL version then? I'm using OpenTK, if that makes any difference.
[editline]...[/editline]
[b]FIXED[/b]
Suspecting my graphics card driver to be messing something up, I reinstalled it and now it shows OpenGL 3.3 perfectly.
[QUOTE=DeadKiller987;30304209]I'm using [cpp]system("cls");[/cpp] to clear the screen, but that is Windows-only. How do I clear the screen in a way that would work anywhere. Preferably in C, not C++.[/QUOTE]
I just make a function that prints like 50 newlines ("\n"). If you print enough newlines you won't see all the previous stuff that was outputted before the newline. (I'm assuming this is command line programs we're talking about here.)
[QUOTE=Chrispy_645;30325291]I just make a function that prints like 50 newlines ("\n"). If you print enough newlines you won't see all the previous stuff that was outputted before the newline. (I'm assuming this is command line programs we're talking about here.)[/QUOTE]
That sounds like a bad solution. What if the user scrolls up? Or if he has a slow computer he might be able to see all the text going up...
[editline]8th June 2011[/editline]
[QUOTE=esalaka;30310700]Wait.
You installed all the libraries required to build this stuff, right? Sounds like your device doesn't have a dynamically linked libc or something
[/QUOTE]
I... think so... I installed the tool chain, and the compiler. Everything should have been included.
[QUOTE=esalaka;30310700]
Add everything to ld search path
-L<libdir> -L<another> or alternatively <waitamin>
[/QUOTE]
Like this?:[code]gcc main.c draw.c -o ass -L/usr/lib -L/lib -L/private/var/lib[/code]
Same error.
[editline]8th June 2011[/editline]
[QUOTE=esalaka;30310700]How did you get such a fucked up install in the first place?[/QUOTE]
No idea.
[editline]8th June 2011[/editline]
[QUOTE=esalaka;30310700]dynamically linked libc[/QUOTE]
I have a libgcc. I'm not sure if it's dynamically linked.
Maybe anyone knows a good way to access packed files together with .exe in c++? ( using 'copy /b src.exe+other.file final.exe', )
[editline]8th June 2011[/editline]
Or i just should look for quite big block of 0x00 bytes and start reading everything that is after that block?
[QUOTE=DeadKiller987;30327101]I have a libgcc. I'm not sure if it's dynamically linked.[/QUOTE]
No I meant the standard C library. That could be -LSystem
I dunno
[editline]8th June 2011[/editline]
[QUOTE=Muffinz!;30328227]Maybe anyone knows a good way to access packed files together with .exe in c++? ( using 'copy /b src.exe+other.file final.exe', )
[editline]8th June 2011[/editline]
Or i just should look for quite big block of 0x00 bytes and start reading everything that is after that block?[/QUOTE]
After the packed files, insert an integer specifying the offset the packed files start from.
[QUOTE=esalaka;30328472]No I meant the standard C library. That could be -LSystem
I dunno[/QUOTE]
Doesn't that come with the tool chain? How can I find out if I have it? What should I search for?
Is this the only way to achieve Game::Bullets?
[code]namespace Game
{
namespace Bullets
{
....
}
}[/code]
[QUOTE=DeadKiller987;30328746]Doesn't that come with the tool chain? How can I find out if I have it? What should I search for?[/QUOTE]
I dunno really
[QUOTE=Miz;30329085]Is this the only way to achieve Game::Bullets?
[code]namespace Game
{
namespace Bullets
{
....
}
}[/code][/QUOTE]
That's a very ambiguous question, I mean... you could get Game::Bullets by doing
[cpp]class Game
{
static int Bullets[];
};[/cpp]
And, that's just one example. What exactly do you need?
[QUOTE=Chris220;30330422]That's a very ambiguous question, I mean... you could get Game::Bullets by doing
[cpp]class Game
{
static int Bullets[];
};[/cpp]
And, that's just one example. What exactly do you need?[/QUOTE]
Wait does that mean you can have a nested namespace?
Of course you can, you can have any number of namespaces inside each other. To my knowledge, anyway. There might be some limit, but I've never noticed any.
Ahh awesome.
BTW I asked this in WAYWO but dont know that anyone there knows.
Are there any modern day FPS with opensource content?
I know that the last ID Tech(4) engine that's open source is Doom 3. Good luck !
[QUOTE=Metaknigth;30332926]I know that the last ID Tech(4) engine that's open source is Doom 3. Good luck ![/QUOTE]
Oh I didnt mean the engine code, I meant the assets like the maps, models, sounds...
Sauerbraten
[editline]8th June 2011[/editline]
[url=http://sauerbraten.org/]this[/url]
I think
[editline]8th June 2011[/editline]
Possibly Warsow?
[QUOTE=esalaka;30333421]Sauerbraten
[editline]8th June 2011[/editline]
[url=http://sauerbraten.org/]this[/url]
I think
[editline]8th June 2011[/editline]
Possibly Warsow?[/QUOTE]
[quote]If you insist on making a standalone game based on Cube 2, do realize that only the sourcecode is yours to use freely (if you abide by the ZLIB license, see below), while the media is not. You can't simply redistribute the entire package with your modified files, as the majority of game media is not yours to use freely (it is made by many authors with a variety of licences and copyright restrictions). Unless you have explicit permission from the authors, or the readme says explicitly "may be used for any purpose" or similar language, it will be illegal to include in your standalone game based on the engine (you may not assume that just because a file has no explicit license, that it is free of copyright). Therefore, if you wish to produce a standalone game, be prepared to make many of the maps, models, textures, sounds etc from scratch yourself. [/quote]
Only the code is open source
Why do you need media in the first place? That's sorta integral to making a game.
If you are just using it for testing, then use it. If you want to be able to sell it, well that's a little strange.
Awwww.
Although it does say [B]majority[/B], eg. some of it is possibly free to use.
[editline]8th June 2011[/editline]
:saddowns:
[QUOTE=esalaka;30334130]Awwww.
Although it does say [B]majority[/B], eg. some of it is possibly free to use.
[editline]8th June 2011[/editline]
:saddowns:[/QUOTE]
Yea, I like Urban Terror's stuff and some of it can be used as you like as long as its not modified
But I think I will just go with CSS stuff :v:
Unless there is any other source game that resembles COD/BC2
[QUOTE=Richy19;30332295]Ahh awesome.
BTW I asked this in WAYWO but dont know that anyone there knows.
Are there any modern day FPS with opensource content?[/QUOTE]
What do you mean by 'modern'? Possibly OpenArena, Nexuiz/Xenotic... Warsow. Stuff like that?
[QUOTE=DeadKiller987;30334755]What do you mean by 'modern'? Possibly OpenArena, Nexuiz/Xenotic... Warsow. Stuff like that?[/QUOTE]
Well like modern wars, so like CSS, Bad company 2, MW1/2...
None of the WW2 or futuristic fantasy stuff
Some guy is using cats as a comparison between public and private in C++.... Could anyone explain it to me better?
[cpp]class ParentFoo
{
public:
ParentFoo(int pub, int pro, int pri):publicBar(pub), protectedBar(pro), privateBar(pri){}
void AccessBarsParent();
public:
int publicBar;
protected:
int protectedBar;
private:
int privateBar;
};
class ChildFoo : public ParentFoo
{
public:
ChildFoo(int pub, int pro, int pri):ParentFoo(pub, pro, pri){}
void AccessBarsChild();
};
void ParentFoo::AccessBarsParent()
{
publicBar = 42; //okay
protectedBar = 42; //okay
privateBar = 42; //okay
}
void ChildFoo::AccesBarsChild()
{
publicBar = 42; //okay
protectedBar = 42; //okay
//privateBar = 42; //error
}
void AccessBars()
{
ParentFoo foo(1, 2, 3); //would work the same with ChildFoo
foo.publicBar = 42; //okay
//foo.protectedBar = 42; //error
//foo.privateBar = 42; //error
}[/cpp]
Does anyone have any decent tutorials on how to do collisions in actionscript 2? It's for a school project :v:
[QUOTE=Chuushajou;30335373]Does anyone have any decent tutorials on how to do collisions in actionscript 2? It's for a school project :v:[/QUOTE]
Collisions for what? Rectangles, squares, circles?
Can anyone recommend me a good 3d framework for C#? I'm looking for one that won't be as unforgiving as opentk, but also won't carry all the load for me, like an engine.
[QUOTE=Mr. Smartass;30340528]Can anyone recommend me a good 3d framework for C#? I'm looking for one that won't be as unforgiving as opentk, but also won't carry all the load for me, like an engine.[/QUOTE]
XNA
What is a good book or site to learn C#?
Sorry, you need to Log In to post a reply to this thread.