collapse collapse

* Who's Online

  • Dot Guests: 129
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Board Stats

  • stats Total Members: 88
  • stats Total Posts: 11164
  • stats Total Topics: 1700
  • stats Total Categories: 4
  • stats Total Boards: 76
  • stats Most Online: 1470

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Nathan

Pages: 1 2 3 4 5 6 [7] 8 9 10 11 12 ... 46
181
Project Advertisment / SimpleGameLibrary
« on: October 11, 2010, 09:36:59 pm »
SimpleGameLibrary (or SGL) is a framework that will allow you to create games fairly easily and without have to learn complex coding styles.

http://code.google.com/p/simplegamelibrary/

Youtube sample:


Sample source:
Code: C++
  1. #include <iostream>
  2. #include "SGL.h"
  3.  
  4. using namespace std;
  5. using namespace SGLEngine;
  6.  
  7. using namespace irr;
  8. using namespace core;
  9. using namespace scene;
  10. using namespace video;
  11. using namespace io;
  12. using namespace gui;
  13.  
  14. class CSquare : public CObject2D {
  15.         public:
  16.                 CSquare()
  17.                 {
  18.                        
  19.                 }
  20.         void init(SGL* engine)
  21.         {
  22.                 this->addLine(vector2di(1,1), vector2di(1,100), engine->getSGLColor()->DARK_GREEN);
  23.                 this->addLine(vector2di(1,100), vector2di(100,100), engine->getSGLColor()->DARK_GREEN);
  24.                 this->addLine(vector2di(100,100), vector2di(100,1), engine->getSGLColor()->DARK_GREEN);
  25.                 this->addLine(vector2di(100,1), vector2di(1,1), engine->getSGLColor()->DARK_GREEN);
  26.         }
  27. };
  28.  
  29. class Enemy : public CObject2D {
  30.         void init(SGL* engine)
  31.         {
  32.                 this->addLine(vector2di(1,1), vector2di(100,1), engine->getSGLColor()->WHITE);
  33.                 this->addLine(vector2di(100,1), vector2di(50,50), engine->getSGLColor()->WHITE);
  34.                 this->addLine(vector2di(50,50), vector2di(1,1), engine->getSGLColor()->WHITE);
  35.         }
  36. };
  37.  
  38. class CBullet : public CObject2D {
  39.  
  40. };
  41.  
  42. class MoveSquare : public SGLAction {
  43.         public:
  44.                 MoveSquare()
  45.                 {
  46.  
  47.                 }
  48.                 virtual void Action(const irr::SEvent& irrevent, SGL* engine)
  49.                 {
  50.                         if (irrevent.KeyInput.Key == irr::KEY_DOWN && irrevent.KeyInput.PressedDown)
  51.                                 engine->get2DObject("cs1")->Move(0,8);
  52.  
  53.                         if (irrevent.KeyInput.Key == irr::KEY_UP && irrevent.KeyInput.PressedDown)
  54.                                 engine->get2DObject("cs1")->Move(0,-8);
  55.  
  56.                         if (irrevent.KeyInput.Key == irr::KEY_LEFT && irrevent.KeyInput.PressedDown)
  57.                         {
  58.                                 engine->get2DObject("cs1")->Move(-8,0);
  59.                                 engine->get2DObject("bullet")->Move(-8, 0);
  60.                         }
  61.  
  62.                         if (irrevent.KeyInput.Key == irr::KEY_RIGHT && irrevent.KeyInput.PressedDown)
  63.                         {
  64.                                 engine->get2DObject("cs1")->Move(8,0);
  65.                                 engine->get2DObject("bullet")->Move(8, 0);
  66.                         }
  67.                 }
  68. };
  69.  
  70. class Esckey : public SGLAction {
  71.         virtual void Action(const irr::SEvent& irrevent, SGL* engine)
  72.         {
  73.                 if (irrevent.KeyInput.Key == irr::KEY_ESCAPE && irrevent.KeyInput.PressedDown)
  74.                         engine->End();
  75.         }
  76. };
  77.  
  78. class FireAction : public SGLAction {
  79.         virtual void Action(const irr::SEvent& irrevent, SGL* engine)
  80.         {
  81.                 if (irrevent.KeyInput.Key == irr::KEY_SPACE && irrevent.KeyInput.PressedDown)
  82.                         engine->get2DObject("bullet")->setYVelocity(-1);
  83.         }
  84. };
  85.  
  86. class ReloadAction : public SGLAction {
  87.         virtual void Action(const irr::SEvent& irrevent, SGL* engine)
  88.         {
  89.                 if (irrevent.KeyInput.Key == irr::KEY_KEY_R)
  90.                 {
  91.                         engine->get2DObject("e1")->setDisplay(true);
  92.                         engine->get2DObject("e2")->setDisplay(true);
  93.                 }
  94.         }
  95. };
  96.  
  97. start()
  98. {
  99.         SGLSettings set;
  100.         set.DriverType = irr::video::EDT_OPENGL;
  101.         SGL engine(set);
  102.         CBullet * bullet;
  103.         bullet = new CBullet();
  104.         bullet->addLine(vector2di(1,1), vector2di(1,100), engine.getSGLColor()->DARK_GREEN);
  105.         bullet->Move(300, 350);
  106.         engine.AddKeyEvent(new MoveSquare());
  107.         engine.AddKeyEvent(new Esckey());
  108.         engine.AddKeyEvent(new FireAction());
  109.         engine.AddKeyEvent(new ReloadAction());
  110.         engine.AddObject(new CSquare(), "cs1");
  111.         engine.AddObject(bullet, "bullet");
  112.         engine.AddObject(new Enemy(), "e1");
  113.         engine.AddObject(new Enemy(), "e2");
  114.         engine.get2DObject("e1")->Move(200, 50);
  115.         engine.get2DObject("e2")->Move(400, 50);
  116.         engine.get2DObject("cs1")->Move(250, 500);
  117.         irr::video::SColor back = engine.getSGLColor()->BLACK;
  118.         SGLSceneSettings sceneset;
  119.         sceneset.color = back;
  120.         while(engine.DeviceIsRunning())
  121.         {
  122.                 if (bullet->getY() < 0)
  123.                 {
  124.                         irr::s32 bx, by;
  125.                         bx = engine.get2DObject("cs1")->getX();
  126.                         by = engine.get2DObject("cs1")->getY();
  127.                         bullet->reset();
  128.                         bullet->setYVelocity(0);
  129.                         bullet->Move(bx+50, by-150);
  130.                 }
  131.                 if (bullet->collidesWith(engine.get2DObject("e1")))
  132.                 {
  133.                         irr::s32 bx, by;
  134.                         bx = engine.get2DObject("cs1")->getX();
  135.                         by = engine.get2DObject("cs1")->getY();
  136.                         bullet->reset();
  137.                         bullet->setYVelocity(0);
  138.                         bullet->Move(bx+50, by-150);
  139.                         engine.get2DObject("e1")->setDisplay(false);
  140.                 }
  141.                 if (bullet->collidesWith(engine.get2DObject("e2")))
  142.                 {
  143.                         irr::s32 bx, by;
  144.                         bx = engine.get2DObject("cs1")->getX();
  145.                         by = engine.get2DObject("cs1")->getY();
  146.                         bullet->reset();
  147.                         bullet->setYVelocity(0);
  148.                         bullet->Move(bx+50, by-150);
  149.                         engine.get2DObject("e2")->setDisplay(false);
  150.                 }
  151.                 engine.BeginScene(sceneset);
  152.                 engine.DrawAll();
  153.  
  154.         }
  155.         return 0;
  156. }

Next steps:
  • Improve collision detection
  • Implement handling of sprites/2D images

Short term goals:
  • Create several games using the framework
  • Documentation

Future goals:
  • 3D graphics
  • 3D collision detection

182
Beta Releases / Re: The Program
« on: October 11, 2010, 09:27:15 pm »
The question I am asking is how will I add menus O.o I got the plain design settled and created.

Code: C++
  1. //Creating a simple program
  2.  
  3. #include <windows.h>
  4.  
  5. LRESULT CALLBACK WndProc( HWND, UINT, WPARAM, LPARAM );
  6.  
  7. int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
  8. {
  9.     MSG msg;
  10.     HWND hwnd;
  11.     WNDCLASS wc;
  12.    
  13.     //The Fonts
  14.     wc.style = CS_HREDRAW | CS_VREDRAW;
  15.     //Set to 0 cause were not using
  16.     wc.cbClsExtra = 0;
  17.     wc.cbWndExtra = 0;
  18.     //Choosing the application name
  19.     wc.lpszClassName = TEXT("Simple Program");
  20.     wc.hInstance = hInstance;
  21.     //Choosing the font
  22.     wc.hbrBackground = GetSysColorBrush(COLOR_3DFACE);
  23.     //Not used because we are not adding menu buttons
  24.     wc.lpszMenuName = NULL;
  25.     wc.lpfnWndProc = WndProc;
  26.     //Configuring so that the arrow is displayed on the screen
  27.     wc.hCursor = LoadCursor(NULL, IDC_ARROW);
  28.     //Configuring the icon that is being used
  29.     wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
  30.    
  31.    
  32.     //Registering the window & Chooseing the size
  33.    
  34.     RegisterClass(&wc);
  35.     hwnd = CreateWindow( wc.lpszClassName, TEXT("Simple Program"),
  36.                WS_OVERLAPPEDWINDOW | WS_VISIBLE,
  37.                //Window size
  38.                500, 500, 500, 500, NULL, NULL, hInstance, NULL);
  39.      
  40.      
  41.      //Showing the window and shows the messages
  42.      ShowWindow(hwnd, nCmdShow);
  43.      UpdateWindow(hwnd);
  44.      
  45.      while(GetMessage(&msg, NULL, 0, 0)){
  46.             DispatchMessage(&msg);
  47.            
  48.         }
  49.         return (int) msg.wParam;
  50.     }
  51.    
  52.     //FINISHING OFF
  53.    
  54.     LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
  55.     {
  56.         switch(msg)
  57.         {
  58.             case WM_DESTROY:
  59.                 {
  60.                     PostQuitMessage(0);
  61.                     return 0;
  62.                 }
  63.             }
  64.             return DefWindowProc(hwnd, msg, wParam, lParam);
  65.         }    
  66.  
It feels like there is some code missing....

183
Java / Re: Palindrome
« on: October 11, 2010, 09:25:11 pm »
You can use a offset for each side on "skips" in the phrase. Just test the character before you test it to the other side. If it is a space or any other special key, just add 1 to the offset. Or you can just do a preliminary filter and go through removing all the spaces and punctuation. Something similar to
Code: C++
  1. int currentPos = 0;
  2. int i = 0;
  3. string unfilteredString = "Testing a string out.";
  4. string filteredString = "";
  5. while(Not at end of string)
  6. {
  7.     if(unfilteredString[ i ] == ' ' || unfilteredString[ i ] == ''' || ...)
  8.    {
  9.        i++;
  10.    }
  11.    else
  12.    {
  13.        filteredString[currentPos] = unfilteredString[ i ];
  14.        currentPos++;
  15.        i++;
  16.    }
  17. }
  18.  

Of course that was just pseudo code. After removing everything, you should be able to do your normal test and it will work.
As far as upper/lower case - just change the case of all the characters to a single case.
And just put all punctuation in an array, loop through it and remove the punctuation characters in the array.

184
Software support / Re: torrents
« on: October 07, 2010, 02:58:31 pm »
The goverment only care if you download the content onto portable media for profit purposes
In the US that is 100% not ture.

185
Updates / Re: Server Stability
« on: October 01, 2010, 12:08:47 pm »
The server Nathan currently has us on is having some issues. If the site goes down, give it time. It will be back up. We are not disappearing!
It's the weirdest thing, the whole system locks up. I am attributing it to a kernel upgrade, but I think I mitigated it with nomodeset ( http://serverfault.com/questions/80520/ubuntu-server-9-10-freezes-up-after-10-minutes ), I'll continue to monitor and if it happens again I will migrate to a "fresh" server. I really didn't want to do it today because today is my vacation :).

186
Software support / Re: torrents
« on: October 01, 2010, 11:58:05 am »
Torrenting itself is not illegal. The content you torrent is what is illegal. Meaning just torrent data with a different title and the government will never know unless they dig far deeper. That will rarely happen unless you already caught their eye.
Actually there is API you can use to find the all the connected peers (with IPs) without actually downloading anything from the torrent. Though, they are mostly watching the 0 day releases.

187
Project Advertisment / Re: Flash Website
« on: September 14, 2010, 09:48:13 pm »
Hey, Quick post. Will add more to it later.

I was wondering if anyone wanted to help start up a flash game site. We would make most the games, add user submission later possibly.

I can make some simpler games at the moment, I need graphics and people who are good with Flash.

Gonna be doing Mysql and Php as well, But I think I can handle that.

Also will need a website design.

Ideas? Anyone want to help?
Send me an email if your interested in hosting, I'm sure we can arrange something.

188
Technology / Re: Next up on my wish list? A Transparent Monitor!
« on: September 12, 2010, 04:28:55 pm »
Neat, but I can't really see any real uses for that. Especially if people can see what you're working on from the other side of the monitor.

But maybe it'll please the "l33ts" who are getting bored of their transparent windows and terminals already... ;)
You can read backwards? Amazing ;).

Although, this probably isn't for the pr0n enthusiast. But hey, maybe by the time this hits mainstream, maybe pr0n won't be so taboo. Last I heard they were warning parents about the dangers of certain audio tracks that can induce certain drug like effects.

189
Hardware Support / Re: Video card not identified?
« on: September 12, 2010, 04:24:36 pm »
Uninstall then reinstall your graphics driver by hand. Don't use the HP tool.
Sometimes you can only get drivers from the reseller, in this case HP. I know ATI used to do this when I had a HP Compaq V2000 - if I tried to download the "official" drivers from ATI they told me that an ATI card could not be found. But the HP ATI drivers worked, but they were not the latest release.

Nvidia should have their drivers on their site though.

190
Humor / Re: My drinking pals and our 3 dots game
« on: September 06, 2010, 09:43:17 am »
At least you didn't do what most other teenagers do - post pictures of them DOING the drugs.

191
Beta Releases / Re: ProjectY Beta
« on: September 05, 2010, 08:51:32 pm »
See attached:
* ProjectX.zip (37.79 kB - downloaded 657 times.)

192
Beta Releases / Re: ProjectY Beta
« on: September 04, 2010, 08:21:40 pm »
Mine was in C# (it was actually in Qt first).
I would be willing to release the source if you want to continue it.
Protip: C# isn't a graphical toolkit, and Qt isn't a programming language.

"I drove a car first but then I switched to CD." Many cars have CD players and so can play CD's (like many programming languages have an API for Qt and thus can use it), but you sure as hell won't be driving a hundred kilometers with a CD disk (like you won't be programming a full-fletched application with just a graphical toolkit).
I'm confused by your post, I think there is a "lost in translation" going on here.
Perhaps I should rewrite the post to be more clearer:

ProjectX was written in C# (the original version was actually written in C++ using Qt).
I would be willing to release the source if you want to continue it.

193
Beta Releases / Re: ProjectY Beta
« on: September 04, 2010, 04:54:29 pm »
Well Nathan already started something like this. Looked cool so I thought I would make one in C#

Its far from done, and didnt really do any bug testing.

Some Screenshots:
http://img155.imageshack.us/i/83187082.jpg/
http://img163.imageshack.us/i/73305620.jpg/
http://img816.imageshack.us/i/76281271.jpg/

All for now, Might try the ideas Cele posted in the other thread.


Mine was in C# (it was actually in Qt first).
I would be willing to release the source if you want to continue it.

194
C++ / Re: Game engine thoughts
« on: August 07, 2010, 05:08:21 pm »
How do you intend to store the objects and draw them?
They would be stored in a map, and Irrlicht would be the graphics engine I'll use to do most of the work.

195
C++ / Re: Game engine thoughts
« on: August 05, 2010, 07:38:34 pm »
Mmmm, I still don't understand fully. From what I read, you don't access it the same as giving a integer value, but by creating a iteration to find it through a given key. I still don't understand how
Code: C++
  1. engineptr->objects["cube"]->move(x,y);  
will turn into
Code: C++
  1. engineptr->objects[value]->move(x,y);  
  2. // or
  3. engineptr->objects("cube")->move(x,y);  
  4.  

The page you referred me to DOES make use of both a key and a value, however I see nothing about using [] to access it.
Quote
Maps are also unique among associative containers in that they implement the direct access operator (operator[]) which allows for direct access of the mapped value.
That says you can access it via the mapped value, not they key "cube".
See the example here:
http://www.cplusplus.com/reference/stl/map/operator[]/

In the example they are using a char for the key, but you can use ANY datatype you like (ie string) as a key datatype because the map class is really just a template class and that is how you initialize it.

Due to the way a map object is, you can iterate through all objects or reference a specific object in the list.

They exist in some form, albeit not as powerful, in almost every high level language I can think of:
Python -> Dictionary
PHP -> Associative Array
C# -> Hashtable

196
C++ / Re: Game engine thoughts
« on: August 05, 2010, 05:44:23 pm »
Aside form the fact that I don't see that compiling anytime soon. The idea itself looks simple and straight forward. If your going to have two different libraries (3D vs 2D) running side by side and rendering, then you would most likely want to make sure the 2D has the lowest Z depth so it is always on top. The idea of assigning ID's as strings is a bit odd. What happens if you have more then 100 or so objects? Or maybe you want to "automate" the create of multiple objects. The best you could do is concoct strings and current values together. Even so, you would have to keep track of each one by it's name to move it. Maybe having a global assignment of some sort to find each object "of type" inside the object list would be better then using a string. Of course that entire idea assumes that "cube" and "square" are not identifiers for global types and just unique names for each object created. Also, I did not notice any update function. How would the engine call to the Input class to call the kbevent when all your calling is "running()". You have no global draw method either from what I can see in your example, so every object created, you would have to check if it was created properly, and if it is still "alive" before drawing it. A way around this is to just call all your updates inside the "running()" function. Like I said though, it is hard to tell with such a small example and no further future ideas or plans said to us.

Also, this one line bothers me a LOT
Code: C++
  1. engineptr->objects["cube"]->move(x,y);
How do you intend to use a string as a index offset in the array? O_o

For now, that is my thought on the current code I've seen.
For your last comment:
STL map

197
C++ / Game engine thoughts
« on: August 04, 2010, 10:17:41 pm »
I want to re-create my game engine from scratch (again), and I was wondering what your thoughts would be on the functionality of this code
My goal is simplicity

Code: C++
  1. class Object
  2. {
  3.         public:
  4.                 string name;
  5. }
  6.  
  7. class Object3D : public Object
  8. {
  9.         public:
  10.                 int x;
  11.                 int y;
  12.                 int z;
  13. }
  14.  
  15. class Object2D : public Object
  16. {
  17.         public:
  18.                 int x;
  19.                 int y;
  20. }
  21.  
  22. class cube : public Object3D
  23. {
  24.         cube() : x(0), y(0), z(0), name("cube") {}
  25. }
  26.  
  27. class square
  28. {
  29.         ...
  30. }
  31.  
  32. int main()
  33. {
  34.         SGL Engine(paramters);
  35.        
  36.         c = cube();
  37.         s = square();
  38.        
  39.         Engine->Lib3D->AddCube(&c, "cube");
  40.         Engine->Lib2D->AddSquare(&s, "square");
  41.         Engine->Input->keyboard(&kbevent);
  42.         while(Engine->running())
  43.         {
  44.                 if (x)
  45.                         Engine->Draw("cube");
  46.                 else
  47.                         Engine->Draw("square");
  48.         }
  49. }
  50.  
  51. void kbevent(event-paramteres)
  52. {
  53.         if (key.up)
  54.                 engineptr->objects["cube"]->move(x,y);
  55. }

I just wanted to see what your thoughts are.

Second edit!


[edited name=Nathan date=1280978865][/edited]

198
General Talk / Alien Swarm
« on: July 21, 2010, 08:54:13 pm »
I played this the other day:
http://store.steampowered.com/app/630/

And was not impressed, but my one friend really likes it.

199
General Talk / Re: New job
« on: July 11, 2010, 10:25:39 pm »
Congratulations. What does a job as an "IT Solutions Associate" entail?
In a nutshell - automation. Making "solutions" that don't require another person to handle the workload.

200
General Talk / New job
« on: July 11, 2010, 09:21:13 pm »
I know this is kind of late, but....

As of June 21st I am a full time, permanent, employee of Argonne National Labs. My official title is "IT Solutions Associate".

201
Introductions / Re: Hello
« on: July 08, 2010, 06:46:19 pm »
I sent you a PM about a specific question. If you have time maybe you could take a look, or I can just post it publicly. Thanks for the Welcome.
It would probably be better if you posted it publicly.

202
Where exactly do I get ethernet drivers and which one that would be compatible with my computer?
Btw, would I google NIC Drivers for Windows XP Intel Celeron?
Now I see its a broadband modem. Google for the ID of the device. You can find that by clicking on the device in the device manager.

203
w8, Nathan, excuse my prev. sentence. Im not sure if its a NIC driver I need.

http://www.tomharriscellular.ca/images/high%20speed%20lite.bmp
http://www.tomharriscellular.ca/internet/help-guides

Thats the modem I use.
My motherboard is a .....Im not completely sure o_O
Proc. is Intel Celeron,
OS. Cracked Windows XP Professional.

It cannot detect my Ethernet plug from my modem.
That is a broadband modem. Does Windows XP detect the ethernet connection? If not, then you need ethernet drivers.

204
Btw, would I google NIC Drivers for Windows XP Intel Celeron?
Now I see its a broadband modem. Google for the ID of the device. You can find that by clicking on the device in the device manager.

205
Who is your ISP?

206
I reinstalled Windows XP onto my old computer, and when I directly plugged my internet modem connection to it, it said the computer did not detect any internet connections. I think this would have someething to do with the driveers or w/e, but Im waay too tired these pass few days to figure it, help guys?  :P
By internet modem connection do you mean dial-up or broadband connection?

207
Software support / Re: I want to block bots (Server Hosting Question)
« on: June 24, 2010, 10:59:34 am »
iptables?

208
Trash / Re: Re: I need some help with a script
« on: June 17, 2010, 07:59:28 pm »
Locked due to no response.

209
General Talk / Re: Microwaving ramen
« on: June 07, 2010, 07:30:05 pm »
I used to do this when I was younger... I'm smarter now.
Microwave ramen in the Styrofoam containers?
Yes.
Weird.

210
Hardware Support / Re: Problems reviving old computer
« on: June 07, 2010, 07:29:43 pm »
That, actually, may be the problem.  I checked out the board and there are a few caps near the processor that have a small amount of the ominous rusty brown substance on top.  However, the amount really is so miniscule that you have to look really close to see it.  This could also explain the overheating beep code.  If the caps are bad, the cpu voltage could be fluctuating to a high value causing the cpu temps to rise.  I want to try another power supply to be sure, but it seems the power supply in my desktop won't work with this board.

*EDIT*

I was able to hook it up to a known working PSU and still ran into the issue.  So, I'm blaming the caps.  Good call.
I would have to concur with Justin on this one.

Pages: 1 2 3 4 5 6 [7] 8 9 10 11 12 ... 46

Donate


* Search


* Recent Posts

I miss the chatbox by Shishka
[August 27, 2019, 11:52:39 pm]


Image Comparison by Shishka
[May 15, 2017, 01:18:02 pm]


Re: srchub - free source code hosting by Nathan
[December 14, 2015, 11:37:02 pm]


Re: srchub - free source code hosting by Celestialkey
[November 27, 2015, 08:51:42 am]


Updates by Nathan
[October 30, 2015, 08:27:36 pm]