• Content count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About yboris

  • Rank
  1. What to use to create a 2D Puzzle Game?

    Thank you jbadams and jackofalllanterns! I'm somewhat reluctant to learning a new language - and I think I've gotten quite used to C++ in my few weeks of agony over Gravity Wars :P I've tried "Game Maker" (as well as "Game Factory 2" that was used to make Knytt Stories) - but everything is counter-intuitive and requires learning how to deal with it. Seems like if I use Visual C++ I'll just have to learn how to load bitmaps as sprites (with transparency); turn my theoretical understanding of OOP into the right syntax; and learn a few things here and there about minor details. I am staying away from Flash for now - but I will think about it hard before I start coding. Thank you for your responses. I welcome any other comments others have :)
  2. My friend wrote an amazing puzzle game, but it only runs on Mac. I asked him permission to re-write the game for Windows and he agreed. The (cropped and trimmed) screenshot should be informative. The user interacts by clicking on squares (placing blocks), when s/he presses "run" the simulation runs (ball flies around doing stuff). I have written a game before: Gravity Wars and am somewhat comfortable with C++. I programmed Gravity Wars with Visual C++ 2008 (starting with awful code that makes drawn things disappear when user minimizes the window). My question: Will using Visual C++ 2008 make things more problematic than using something else? I have glanced at the "Make a Tetris clone in an hour -GameDev.net" and I guess I just need to populate my game with sprites that behave in Tetris-like ways? Many thanks ahead of time :)
  3. What are you reading right now?

    "Legalize This!" by Doug Husak Amazing book. Re-reading parts of it. It's an argument for decriminalization of drugs :)
  4. MASSIVE THANK YOU Thank you all for your contributions. My website is now up and I listed you as contributors to my program. http://gravitywars.yboris.com
  5. Quote:...You need to read through what oler1s and Sneftel have written... Thank you very much, between you and everyone who contributed - I finally managed to get the damn 'extern' to work without complaining ... and a little bit after ... ZOMG !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :D THANK YOU - IT WORKS !!! I love you all forever. Visithttp://www.yboris.com/gravitywars/gravitywars.htmlto download a working implementation (with properties) of my game :) [Edited by - yboris on June 11, 2008 1:00:50 AM]
  6. Slowing down a program

    Quote:Original post by monkey4sale alright, thanks. Now it works, woot. Though you have solved your problem, while working on Visual C++ 2008, I have found this to work very well: Sleep(10); I hear though that it won't slow down every computer exactly 10ms, but it will be close enough. Given this is in milliseconds, you can fine-tune it rather well :) Hope it works!
  7. Quote:Original post by Sneftel As I said: You need to put the definition in a separate .cpp file. It cannot be in a header file ... Did you read the article I linked yet? I am a beginner - and I have been told that there is no difference between .cpp or .h - they are just conventions to get you thinking in terms of headers and code ... of course I'm still vague on what either of them are. I have read the article even before I tried the first time to make the program work, and upon your suggestion looked at it again. I must be missing something - but it seems like it isn't addressing my problem. I think I get roughly the mistakes the article points out I shouldn't be making - and as far as I understand - I am not making them. I have attempted to create a separate file (floats.cpp) that includes (#include "globals.h") my original definition of variables (with 'extern') and re-defines them "float _x = _cx" within a new namespace "Bar". This compiles well - until I try to get my "properties.h" (Form2) to access the new file. ... thank you again for your time in trying to get it to work ... but I repeat - I'm not programming C++, this is Visual C++ 2008 (.NET 3.5) with its own quirks (syntax) and oddities. I hear C# doesn't even have "global variables" ... I don't know what sort of differences are in this C++/CLI :( If someone has Visual C++ 2008 - could you share a working - compilable code that does what I'm trying to achieve? I'm willing to pick it apart on my own and figure out how to adapt it to my code. Thank you :)
  8. Quote:Original post by Sneftel ... you need to declare the variable as extern: extern float _cx; And then, in exactly one .cpp file you put the definition: float _cx=3; ... Thanks for the speedy suggestion - but sadly this "extern" doesn't fix up my problem. I still get the error I stated above. Perhaps a quick recap is in order: I have two forms and "globals.h" that has my variables. The code that compiles well (with Form1 seeing the variables) but as soon as I want my Form2 (properties.h) to "see" the variables - I get the error: shareforms.obj : error LNK2005: "float Foo::_x" (?_x@Foo@@$$Q3MA) already defined in properties.obj I am certainly not trying to define the variables - but the program may think it - because I have "properties.h" #include "globals.h" ... and that is where it fails.
  9. Quote:Original post by raptorstrike hmmm well make sure that the namespace file doesn't include any of the files including it (cyclical inclusion). Here is a minimal example which compiles just fine working on the same principal... Thank you for your time and effort, but sadly that code isn't simply (if at all) converted to fit into the Visual C++ 2008 pre-existing code. There is no "main.cpp" (so I tried the best I could to accommodate) I decided to restart from scratch - built my new code as closely related to what you wrote - and things compile well until the final step - where I let my "properties.h" #include "globals.h" (this time around I called it that). properties.obj : error LNK2005: "float Foo::_x" (?_x@Foo@@$$Q3MA) already defined in shareforms.obj C:\Documents and Settings\Boris.MINIPC\My Documents\Visual Studio 2008\Projects\shareforms\Debug\shareforms.exe : fatal error LNK1169: one or more multiply defined symbols found :( ... if anyone skilled in Visual C++ 2008 Windows Forms has a file they could send me - I'll look and figure it out. Thank you again!
  10. Quote:Original post by raptorstrike ... sharevariables::_cx ... Hope that helps [smile] Thank you for the help - but sadly that doesn't work ... if I do what you said then I get the same error as above (though it IS bizarre - as the auto-complete allows me to type in what you said) If I #include "constants.h" in the "properties.h" I get this: error C2374: 'sharevariables::_cx' : redefinition; multiple initialization and if I do the following in my "constants.h" #ifndef _CONST_ #define _CONST_ namespace sharevariables { float _cx=3; float _cy=2; float _cz=0; } #endif I get an error like this: share variables.obj : error LNK2005: "float sharevariables::_cz" (?_cz@sharevariables@@$$Q3MA) already defined in properties.obj It's driving me UP THE WALL! ... Perhaps someone has played with what I'm doing - and has a simple project that they could just send me - and I can just figure it out ? I'm sure it's supposed to work easily - I'm just not getting something :(
  11. Hello my dear friend; I have spent over 4 hours and my friend (who knows C++ far better than me) another hour trying to get a simple thing to work: share variables across "Windows Forms". Simple C++ doesn't work as I'm using Visual C++ 2008 (which is C++/CLI - I am told). I want to have a few variables (float x, y, z) in some file "constants.h" which can be accessed by both - the main "Form1.h" (program window) and the properties box "properties.h" (where the user will be able to input values and thus affect the behavior of Form1). The file is called "share variables" so I have the // share variables.cpp : main project file. #include "stdafx.h" #include "constants.h" using namespace sharevariables; // not sure what it does - but need it - it seems #include "properties.h" #include "Form1.h" // constants.h - all the variables here namespace sharevariables { float _cx=3; float _cy=2; // define so I can see they work float _cz=0; } Now the most curious thing - Form1.h has no problem accessing and changing _cx and other variables defined in "constants.h" but "properties.h" gives me an errors: error C2039: '_cx' : is not a member of '`global namespace'' error C2065: '_cx' : undeclared identifier ... :( Please help - I will be able to finally finish my "GravityWars" !!! http://www.yboris.com/gravitywars/gravitywars.html
  12. Hello everyone, it's my first post - so let me know if I'm out of line with the program :) I am a beginner who learned some Visual C++ 2008 and made a simple 2D game: http://www.yboris.com/gravitywars/gravitywars.html The code is a combination of stuff I found online and my 'ingenuity'. Sadly I am unable to find or figure out how to create different layers. I want something very simple: 3 Layers (1) stars (2) lines (3) planets This way I can simply have a function that draws lines - but always 'below' the planets - so that I don't need to worry about drawing over the planet by accident. I'm sure it's something rather simple - but I can't figure it out :( Another VERY big problem - every time I minimize the program or a window is on top of the game - EVERYTHING BENEATH is erased :( ... I'd like to have some sort of a way of 'saving' what is drawn (like when you paint in MS Paint) from simple intrusions like that :)