• What are you working on? v15
    5,001 replies, posted
IIRC if you rotate then translate, it'll move the object not to an X,Y coordinate, but forward by Y and sideways by X based on the rotation. I usually have it: Translate, Rotate, Scale.
I've been working on my first game with a storyline. All my other projects were just games itself, nothing to follow up on. So I thought it would be fun to have a little story for once. It's called "What Happened?". I haven't got a lot done really, but I made my first sample scene. [media]http://www.youtube.com/watch?v=cdiCLhLQip0[/media]
0:33 - "I would HAVE told you but..." or "I would've told you but..."
[cpp] pathData CFilesystem::getPathData(const string& path) const { string fullPath = path; if(!isPathAbsolute(fullPath)) { // If the path isn't absolute, it's relative to the executable. fullPath.insert(0, executablePath); } fullPath = getRealPath(fullPath); if(fullPath == "") { return pathData{"", pathType::none}; } pathType type = getPathType(fullPath); if(type == pathType::directory) { fullPath += '/'; } return pathData{fullPath, type}; } #ifdef _DENGINE_LINUX_ string findExecutable(void) { char executable[PATH_MAX]; if(readlink("/proc/self/exe", executable, PATH_MAX) == -1) { string(""); } return executable; } string getRealPath(const string& path) { char realPath[PATH_MAX]; if(realpath(path.c_str(), realPath) == 0) { return string(""); } return realPath; } pathType getPathType(const string& path) { struct stat info; int status = stat(path.c_str(), &info); if(status == -1) { switch(errno) { case ENOENT: // A component of the path does not exist. return pathType::none; default: return pathType::unknown; } } if(S_ISDIR(info.st_mode)) { return pathType::directory; } if(S_ISREG(info.st_mode)) { return pathType::file; } return pathType::unknown; } bool isPathAbsolute(const string& path) { // Starting at the root directory is a sign of it being absolute. return (path[0] == '/'); } #else #error Implement this! #endif[/cpp] Working on obfuscating my code. Can you guess what it does?
[QUOTE=xAustechx;27626660]I've been working on my first game with a storyline. All my other projects were just games itself, nothing to follow up on. So I thought it would be fun to have a little story for once. It's called "What Happened?". I haven't got a lot done really, but I made my first sample scene. [media]http://www.youtube.com/watch?v=cdiCLhLQip0[/media][/QUOTE] Why do you have a physics engine in a topdown game?
[QUOTE=geel9;27627210]Why do you have a physics engine in a topdown game?[/QUOTE] :what:
[QUOTE=robmaister12;27626887]0:33 - "I would HAVE told you but..." or "I would've told you but..."[/QUOTE] Oh my god. This is embarrassing. I'll put an annotation on it right now.
My IR glasses ready for a WiiMote hack. [media]http://img402.imageshack.us/img402/2287/glassesc.jpg[/media]
[QUOTE=Shrapnel :3;27627520]My IR glasses ready for a WiiMote hack. [media]http://img402.imageshack.us/img402/2287/glassesc.jpg[/media][/QUOTE] Latest fashion trend en route
I hope you used resistors with the LEDs or they might hack your face. [editline]24th January 2011[/editline] Also, why does it seem like it's floating?
The shadow seems to be cast mostly on the 2nd layer of the glass table, also it's actually on an angle because it's heavy on the side with the battery. There is a resistor on there but it's under the switch on that view.
[QUOTE=geel9;27627210]Why do you have a physics engine in a topdown game?[/QUOTE] Why not?
Because apparently geel9 doesn't realise that physics also control things on the non up/down axis.
[QUOTE=Vbits;27626141]Anyone else going to be in the Global Game Jam?[/QUOTE] Yup
Need some advice about threading... I've currently got a class in its own thread, which in turn might run it's own functions in a 2nd thread. Is this bad practice? Also, what's the preferred way to deal with a queue? foeach through the queue or while not empty, pop?
[QUOTE=CarlBooth;27631115]Also, what's the preferred way to deal with a queue? foeach through the queue or while not empty, pop?[/QUOTE] Pop I would say
I finally got my space invaders game in a working condition: [img]http://filesmelt.com/dl/SI4.png[/img] [url]http://filesmelt.com/dl/Space_Invaders.zip[/url] Left/Right: Move Z: Shoot P: Pause A: Quit (my esc key is broken) Make sure you run from the shortcut! (Otherwise the program can't find the lwjgl natives - any suggestions to fix this?) (Also, the game over condition isn't implemented properly yet - it just pauses the game, so you can press P to carry on until the next time you fail)
I've decided Facepunch for Android will not support logging in as long as there is no secure way to interact with the API. I'll start working on the thread listing now (the only part I haven't designed yet, so expect a mockup soon).
[QUOTE=Overv;27632044]I've decided Facepunch for Android will not support logging in as long as there is no secure way to interact with the API. I'll start working on the thread listing now (the only part I haven't designed yet, so expect a mockup soon).[/QUOTE] I don't know much about the FP API or anything similar. When you say about a secure way to interact with the API, what do you mean? Is there no way to connect securely via https or is it a problem with the API itself?
[QUOTE=Jallen;27632091]I don't know much about the FP API or anything similar. When you say about a secure way to interact with the API, what do you mean? Is there no way to connect securely via https or is it a problem with the API itself?[/QUOTE] He is afraid of people decompiling his app, and taking his API key. All i can recommend is splitting the API into several strings so a simple strings search does nothing.
[QUOTE=nekosune;27632150]He is afraid of people decompiling his app, and taking his API key. All i can recommend is splitting the API into several strings so a simple strings search does nothing.[/QUOTE] I guess at the end of the day, there is no way to do it in a truely secure way, even if you jumble the key all over the place. People can still piece it together with not much effort I expect. So really it's something that needs to be dealt with I guess.
[QUOTE=nekosune;27632150]He is afraid of people decompiling his app, and taking his API key. All i can recommend is splitting the API into several strings so a simple strings search does nothing.[/QUOTE] No, as mentioned earlier in this thread, I can secure my API key perfectly well by routing all API calls through my server. But people don't want to put that trust into me.
[QUOTE=Overv;27632254]No, as mentioned earlier in this thread, I can secure my API key perfectly well by routing all API calls through my server. But people don't want to put that trust into me.[/QUOTE] But that means we wouldn't be able to post :ohdear:
[QUOTE=Overv;27632254]No, as mentioned earlier in this thread, I can secure my API key perfectly well by routing all API calls through my server. But people don't want to put that trust into me.[/QUOTE] Let them decide whether to send sensitive information or not?
[QUOTE=raBBish;27632314]But that means we wouldn't be able to post :ohdear:[/QUOTE] Until compwhizzi fixes the API or people are willing to trust me. I can understand that a moderator does not want to use it, because I could request threads from the mod forum without anyone ever knowing. But apart from that, the only private info that is sent to me is a username, unique device identifier and MD5-hashed password.
Starting with the menu for live 2 die Have this soo far (nothing exciting) [media]http://www.youtube.com/watch?v=Da37rWHg_fU[/media] Just need to add smoke and the menu options, also how do you reference in C#?
[QUOTE=Richy19;27632393]Starting with the menu for live 2 die Have this soo far (nothing exciting) [media]http://www.youtube.com/watch?v=Da37rWHg_fU[/media] Just need to add smoke and the menu options, also how do you reference in C#?[/QUOTE] Not sure if you mean this, but you can right click "References" in the solution explorer and click "Add Reference".
[QUOTE=Overv;27632383]Until compwhizzi fixes the API or people are willing to trust me. I can understand that a moderator does not want to use it, because I could request threads from the mod forum without anyone ever knowing. But apart from that, the only private info that is sent to me is a username, unique device identifier and MD5-hashed password.[/QUOTE] Make logging in optional? Add a button to "login" as a guest without posting privileges or something like that.
[QUOTE=CarlBooth;27631115]Need some advice about threading... I've currently got a class in its own thread, which in turn might run it's own functions in a 2nd thread. Is this bad practice? Also, what's the preferred way to deal with a queue? foeach through the queue or while not empty, pop?[/QUOTE] I do this very thing in my allocator, the collector class sits in the primary thread, but is also running in a second one. The collector uses a queue which is lock free, so there is no mutex switching, and I could ensure 100% that it is lock free if I was using atomic operations. Assuming you're writing something with C# (I believe that's what you work in mostly right?), you won't have to worry about this, because all read/write operations on integral data types are atomic according to the specification. Here's the source, so you can get a general idea of what is going on. I'm passing the collector::run function to the thread to execute, and the collector itself to the function. The following while loop isn't the greatest construct, but there needed to be a way to know when the collector was destructing, hence the !self->destruct statements. When the queue is empty of course, the thread is just yielding. At the OS level this causes a decently expensive context switch, so just keep that in mind while working. You may want to look into Windows Fibers as an alternative. They are a lot safer than threads, and a lot faster, since everything exists in the user space. Of course if you're not on Windows, then disregard that :v: [cpp] #include <bank/detail/collector.hpp> #include <bank/detail/thread.hpp> #include <bank/detail/array.hpp> #include <bank/detail/chunk.hpp> #include <bank/detail/pool.hpp> #include <cstdlib> namespace bank { namespace detail { #pragma warning(disable: 4355) collector::collector(pool& memory) : scanner(&collector::run, this), memory(memory), destruct(0), started(0) { this->scanner.start(); while (!this->started) { thread::yield(); } } #pragma warning(default: 4355) collector::~collector(void) { this->destruct = true; this->scanner.wait(); } void collector::remove(const size_t& address) { while (this->objects.full()) { thread::yield(); } // Hopefully by yielding, we can give the collector enough time to remove some objects. this->objects.push(address); } void collector::run(void* actual) { collector* self = static_cast<collector*>(actual); self->started = true; while (!self->destruct) { while(self->objects.empty() && !self->destruct) { thread::yield(); } while(!self->objects.empty()) { size_t address = self->objects.pop(); if (address == 0) { continue; } for (size_t idx = 0; idx < self->memory.size; idx++) { self->memory.list.at(idx).deallocate(address); } } } } }} /* namespace bank::detail */ [/cpp]
[QUOTE=raBBish;27632536]Make logging in optional? Add a button to "login" as a guest without posting privileges or something like that.[/QUOTE] Yes, it'll work like that.
Sorry, you need to Log In to post a reply to this thread.