Jump to content
  • Advertisement

moussen15

Member
  • Content Count

    82
  • Joined

  • Last visited

Community Reputation

175 Neutral

About moussen15

  • Rank
    Member
  1. I'm getting a really strange error when running my MIDlet on my Nokia 6630. It works in the emulator but as soon as I try it on my phone, this error is thrown right in the constructor of my MIDlet. I would be happy if anyone could atleast tell me WHAT it means because google doesn't really want to help me on this one unfortunately ;) The only thing that I see that might be causing this is that I construct my GameCanvas directly in my constructor, as opposed to waiting for a call to startApp(), and I also grab a Graphics object to its backbuffer using getGraphics. Although I'd think the error messages would've been a little more verbose if it were something that simple. Any ideas?
  2. moussen15

    cross-compilation?

    Hey, does anybody know if it is possible to compile windows executables from within your linux OS? I want to make my games playable to my windows-using friends without having to setup a development environment on windows as well. Thanks!
  3. Quote:Original post by _gl_coder_one_ i was actually wondering if there is any such GUI component that does that for me :p Something like a gui_py_shell.py or whatever that does all the indentation etc when i start typing into it [wink] moussen15[\b] if you are talking about InteractiveInterpreter then i have had a look at that although havnt figured out how i can use that [:(] I had planned to use the compile() call to get the code object and then execute the code object using exec() . Wouldnt that be fine ? Please guide [grin] Maybe it could but I really recommend looking into InteractiveConsole or InteractiveInterpreter (depending on your needs). They both make it really simple! Interactive console has a method -> interact() which you just have to invoke and it takes care of the rest for you, but since you wanted it to run inside a GUI component, I suppose you might need to redirect standard output (sys.stdout) to your GUI or something. I myself used InteractiveInterpreter this way: interpreter = code.InteractiveInterpreter(create_user_locals()) while True: line = raw_input(">>> ") while interpreter.runsource(line,"<stjarna console>"): line = raw_input("... ") for my level editor. It works like this: runsource will return True when it wants more input (ie another python line to be entered). otherwise it will simply return False. It takes care of error handling etc for you, but if you want you can subclass its methods to supply your own way of responding to errors. I hope this explanation was clear enough and feel free to ask if there is anything else you're wondering :) EDIT: Fixed indents. Those are important in python ;)
  4. There is already an interpreter that you can use ;) check out the code module in the python library;) It takes care of most things. All you really need to create a shell then would probably be to create a simple text-editing GUI component or something. Hope that helped
  5. moussen15

    Working on a Zatacka clone

    Thank you both for your help :) I stopped reading pixel data from my surfaces and instead saved each worm's position in a sort of collision map, like you suggested, and it worked wonderfully ;) if anyone is interested I used a binary tree for faster searches.
  6. Hello. I'm working on a clone of the old game Zatacka. If you don't know about it it is a game where each player gets to control a worm using two buttons (left and right of course) and the goal is to make all the other players die by colliding with something(the end-of-screen or a worm). I've managed to make the worms move as they should, but now I'm up to the task of collision detection which seems to be quite difficult. The problem is that collision detection is done by comparing pixel values of the underlying SDL_Surface to see if they differ from the background (that was the only method that seemed reasonable to me). This works except that, since each worm consists of a perpetual array of overlapping rectangles, the game will think that the worm has collided with itself each time it checks that overlapping part of the rectangle. I tried to fix that by storing each worm's old position so that I could tell the difference between "real" collisions and "overlapping collisions" which works most of the time, but sometimes the worm collides with a n-game-cycles-old rectangle instead of the one-cycle-old that I thought would be enough to check for. Does anybody see a simpler solution than to store WORM_TURN_ANGLE/COMPLETE_TURN positions? Thanks for your help :)
  7. Quote:Original post by ToohrVyk You are correct. However, the networking part of the Unix module is fairly well implemented on Windows as well, so you shouldn't have much trouble using it. In the docs it says: Quote:The Cygwin port of Objective Caml fully implements all functions from the Unix module. The native Win32 ports implement a subset of them. Below is a list of the functions that are not implemented, or only partially implemented, by the Win32 ports. Functions not mentioned are fully implemented and behave as described previously in this chapter. I don't fully understand what cygwin and what a cygwin port is but the mingw-compiler must qualify as that, right? So as long as I use mingw to compile my programs I will be able to use ALL the functions listed in the unix module? Also, when I have compiled my program(using mingw), will it be dependant on a DLL for those functions to work? Thank you for your time
  8. I'd like to try out OCaml. It seems nice and all, but it seems that only through the Unix-module (which is only moderately implemented on Windows platforms if I understood the docs correctly) can you initiate a network connection. Does anybody have experience with "cross-platform" networking in OCaml and can confirm that this is correct? It just doesn't seem right to rely on a module named <<Unix>> when programming in Windows and I thought there must be some other way, but all I could find was something called CGI (which I think is only for webservers or something) and things that I couldn't understand.
  9. moussen15

    Stupid Errors!

    During the time when I still used makefiles to build my projects (I use jam now. Much better IMHO ), I could run into weird errors when I had started writing on a new source file and maybe modified one of my old header files to be more compatible with the new "module" I was writing. Because I was to lazy to tell make about what header files were needed by what source files [rolleyes], so old object files would stick around that used my un-modified header files' declarations. I sometimes felt like I was going crazy when code I thought I didn't even touch started to fail and I would sit there debugging for hours before finally realizing that maybe I should rebuild the whole project and suddenly all errors go away[totally]
  10. moussen15

    Embedding a scripting language(python?)

    Allright, thank you both for your answers. You have been very helpful. I didn't know I could just ship the DLL (as SiCrane mentioned). That seems like a smart solution (no need to install any additional software if I just pack the python interpreter DLL along with my other game files). This might be a dumb question but I searched the python documentation once more but didn't find any obvious mention as to whether this was what they recommended when embedding python. This is of interest because otherwise these questions come to mind: Will I have to build this DLL myself or are you saying that it already exists and that I should just go into my python install path and grab it from there? Quote:Part of Sneftel's reply It's a good use for an embedded high-level language. In terms of GUI toolkits, though, you really owe it to yourself to check out the existing offerings (many of which embed scripting languages) before rolling up your sleeves and making it from scratch. Designing and programming a GUI toolkit is a particularly difficult, involved, and thankless task, and unless you have lots of experience with programming GUI toolkits already, the result will be considerably less flexible and usable than a premade toolkit. I've looked into a couple of GUIs but I most of them are waaay too complex for me. What I have right now is a std::list of GUIItem-interfaces that have three methods of significance: -update() handles input and all logic associated with the given GUI component -draw() displays it to the user -sendRequests() lets it commonicate with its "engine" (right now there are only 3 requests: TO_FRONT, TO_BACK, REMOVE. Do you still think I should search for already available "GUI toolkits"? This doesn't seem like a whole lot of work to me (I have yet to start implementing any GUI components. I just finnished the design and the engine) but I might be wrong seeing as this is the first time I use a GUI in my game really. Also I think it'd be a good learning experience to embed and use python myself this way. Oh and I should thank you once again, SiCrane, for your tutorial. It will be of great use to be :) [Edited by - moussen15 on August 19, 2006 3:37:38 PM]
  11. Hello I'm in the process of looking for solutions on how to embed a scripting language into my game, and I thought python would be nice since I have some experience with it and I really like it. But before I start I would like to get some help with understanding some things. Here are the things I'm wondering about: - Is it possible to compile a small python interpreter INTO your application? I'd very much like it this way because I am planning on showing my game to my not so computer-savvy friends/girlfriend, and it'd be much better if I could just tell them to "copy this folder to your hard drive and click the executable" than having to tell them to first install a python interpreter and THEN run my game. - The python.org embedding tutorial says something about python trying to figure out my module path. I suppose this is kind of the same question but I would like python to use only the compiled in modules, or the ones that I supply myself through C++. Can I disable this? - Boost.Python seems quite nice (especially since I already use (b)jam to build my projects), but I can't seem to find anything about embedding python with it, only extending it. Would you recommend Boost.Python when embedding python? Would you recommend it at all? Any other thoughts on alternative scripting languages or approaches to my "problems" are greatly appreciated. What I'm planning on using it for is GUI customization (i.e I execute a python-gui-file that creates all my GUI components and handles their input etc), running my game level editor, and AI for my game characters. Thank you for your time :)
  12. class myclass { public: static const int MYCONSTINT = 666; myclass( const int& anotherint = MYCONSTINT ) {} }; int main() { myclass mc; } This code causes an "unresolved reference to myclass::MYCONSTINT" linker error. I might be just tired but I really can't see what is causing this, so help is much appreciated. Removing the ampersand (i.e using a copy of the object instead of a reference) works fine.
  13. This must be possible, but I can't figure out how. I was thinking something like this: class cMyClass { public: int increase( int x, int amount = getStandardIncreaseAmount() ); int getStandardIncreaseAmount(); }; ; But my compiler complains about not being able to call getStandardIncreaseAmount() without an object (adding "this->" doesn't solve the problem because "it can't be used in this context" or something. Does anybody know how to do this?
  14. moussen15

    Help! Where is the error?? :(

    Quote:Original post by GutyGu Thank u! First warning has left the game :P haha. But.. the last two warnings are still there. What's strange here is that before I put "<< endl;" after "Has elegido la opcion uno" and "Has elegido la opcion dos" on DoTaskOne() and DoOtherTasks() functions.. it compiled and worked fine! but after I put that code it doesn't work anymore. I think this day 06/06/06 makes Dev-C++ go crazy.. hahaha Thank u 4 all :) Are you sure those warnings occurred just when you added that code? I just tried compiling it on my Linux machine and it worked without any errors at all. Otherwise would advice you to check if that file "backward_warning.h" hasn't been damaged/removed or something because that is the only thing I can think of. I have never seen that message before :/
  15. moussen15

    Help! Where is the error?? :(

    I don't know if this is the thread you want me to reply to, but as someone mentioned in the other thread, you need to change "<iostream.h>" to "<iostream>", and then you should either replace all cout, cin and endl with std::cout, std::cin and std::endl, or declare that you are using the standard namespace std. it is probably the easiest to just put "using namespace std;" right after you include <iostream>. The only other error I can see is that you never seem to define BOOL (although this might be pre-defined on windows or something, I don't know). EDIT: Now I see that you actually DID define it. Sorry about that Hope that helped ;) [Edited by - moussen15 on June 6, 2006 11:36:55 AM]
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!