• Content count

  • Joined

  • Last visited

Community Reputation

300 Neutral

About eFoDay

  • Rank
  1. stack comprehension question

    Found a link which may have some additional information: http://www.learncpp.com/cpp-tutorial/79-the-stack-and-the-heap/
  2. edited post because I mainly use pointers and then I realized it doesnt work on non-pointers. this is the error you will get: In file included from main.cpp:10:0: Observer.h:16:10: error: field 'myMessage' has incomplete type [source lang="cpp"] class Message; class Observer { Message myMessage; void accessMessage(); } [/source] so actually this gives no error: [source lang="cpp"] class Message; class Observer { Message* myMessage; void accessMessage(); } [/source] this actually doesn't give an error message either: [source lang="cpp"] class Message; class Observer { Message* myMessage; void accessMessage() { myMessage->someFunc(); } } [/source] But trying to access Observer::accessMessage without including the Message header will give an error: In file included from main.cpp:10:0: Observer.h:17:49: error: invalid use of incomplete type 'class Message' Observer.h:11:7: error: forward declaration of 'class Message' [source lang="cpp"] #include "Observer.h" int main(int argc, char** argv) { Observer myObserver; myObserver.accessMessage(); // error return 0; } [/source] To fix the error you will need to include the actual header of Message so it knows about the actual functions. This is the way I usually set up my files: [source lang="cpp"] // .h file class Message; class Observer { Message* myMessage; void accessMessage(); } // .cpp file #include "observer.h" #include "message.h" void Observer::accessMessage() { myMessage->someFunc(); } [/source] And without pointers: [source lang="cpp"] // .h file class Observer { Message myMessage; void accessMessage(); } // .cpp file #include "message.h" #include "observer.h" void Observer::accessMessage() { myMessage.someFunc(); } [/source]
  3. PHP 'include' a relative file?

    I found this link which may be of some help [url="http://net.tutsplus.com/tutorials/php/supercharge-your-css-with-php-under-the-hood/"]http://net.tutsplus....under-the-hood/[/url] I think you need to put <?php header("Content-type: text/css; charset: UTF-8"); ?> in your .php file. Found a couple more links: http://css-tricks.com/css-variables-with-php/ http://www.barelyfitz.com/projects/csscolor/
  4. From what I can see it looks like your switching the colors based on the current player and not based on the player that did the selection. This means that when it's player 1's turn everything (X's and O's) will draw blue and when it's player 2's turn everything will draw red. You could try something like this: [source] struct Holder { float xPos; float yPos; float width; float height; bool isVacant; bool isX; }; // set color to draw if (holders[n].isVacant == true) { glColor4ub(0,0,0,255); // black } else if (holders[n].isX) { glColor4ub(0,0,255,255); // blue } else { glColor4ub(255,0,0,255); // red } // draw rectangle [/source]
  5. Here is a way that I use to find where the mouse is located in the grid: Vector2f getGridLoc(int tileSize) { Vector2f gridLoc; gridLoc.x = std::floor(mouse.x / tileSize); gridLoc.y = std::floor(mouse.y / tileSize); return gridLoc; }
  6. Add html5 game to google+

    [quote name='jeff8j' timestamp='1343076001' post='4962358'] facebook games take an iframe and I was thinking the google plus games would do the same. [/quote] In the insert gadget menu, search for "iframe"
  7. Add html5 game to google+

    found this: http://answers.unity3d.com/questions/53022/google-sites-for-hosting-my-game-issue-tracking.html which led me to this: you can also use gadgets. When editing a page, click INSERT > MORE... choose GAMES to search thru the directory.
  8. Add html5 game to google+

    or this: Create and edit a Google+ page http://support.google.com/plus/bin/answer.py?hl=en&answer=1710691&topic=1710599&ctx=topic
  9. Add html5 game to google+

    perhaps this link? https://developers.google.com/chrome/web-store/docs/publish
  10. Add html5 game to google+

    I found this page for Google Play but not sure if its what your looking for. I went here: [url="https://play.google.com/store/apps?hl=en"]https://play.google....tore/apps?hl=en[/url] Then there is a developers link that goes here: [url="http://developer.android.com/distribute/index.html"]http://developer.and...bute/index.html[/url] and then this link here: [url="https://play.google.com/apps/publish/"]https://play.google.com/apps/publish/[/url]
  11. Easy programming language

    You may want to investigate Alice. [url="http://www.alice.org/"]http://www.alice.org/[/url] [quote name='www.alice.org'] Alice is an innovative 3D [b]programming environment[/b] that makes it easy to create an animation for telling a story, playing an interactive game, or a video to share on the web. Alice is a freely available [b]teaching tool designed to be a student's first exposure to object-oriented programming[/b]. It allows students to [b]learn fundamental programming concepts[/b] in the context of creating animated movies and simple video games. In Alice, 3-D objects (e.g., people, animals, and vehicles) populate a virtual world and students create a program to animate the objects. In Alice's interactive interface, students drag and drop graphic tiles to [b]create a program, where the instructions correspond to standard statements in a production oriented programming language, such as Java, C++, and C#[/b]. Alice allows students to immediately see how their animation programs run, enabling them to [b]easily understand the relationship between the programming statements and the behavior of objects[/b] in their animation. By manipulating the objects in their virtual world, [b]students gain experience with all the programming constructs[/b] typically taught in an introductory programming course. [/quote]
  12. C# Java Html5 need expert Advices

    [quote name='tstrimple' timestamp='1342990655' post='4962027'] There will be an express version. [/quote] It looks like you will be able to develop normal (non-Metro) desktop apps with Visual Studio 2012 Express. We’ll all be using Metro in 2020? [url="http://www.ghacks.net/2012/06/27/well-all-be-using-metro-in-2020-gartner-analysts-think-so/"]http://www.ghacks.ne...lysts-think-so/[/url] [quote name='Tyffa' timestamp='1342932813' post='4961864'] what's the best way to prepare for WinRT and the future of windows development ?? Which main language should I start learning today C#, Java, Html5 ? [/quote] C# can be used to make WinRT or Metro apps and is a good language to start with. Java is a good learning language but you can't make Metro apps with it. JavaScript is a good language to know as a secondary language. C++ is my favourite language and can be used to write WinRT apps.
  13. C# Java Html5 need expert Advices

    I am running Windows 8 Release Preview and Visual Studio 2012 Express RC. I'm not sure if it's just because it's the release preview or if its the express version but there are basically four types of apps you can make with it. All of them are Metro apps. HTML / JavaScript XAML / Visual Basic XAML / Visual C# XAML / Visual C++ There is no Windows Forms designer. It is replaced with an XAML designer. Because of this I believe XAML to be the current future of Windows UI development. If you want the full Microsoft experience then learn XAML and C#.
  14. You use the Steam SDK: [url="https://partner.steamgames.com/"]https://partner.steamgames.com/[/url] Steamworks FAQ [url="http://www.steampowered.com/steamworks/FAQ.php"]http://www.steampowe...amworks/FAQ.php[/url] [quote] 1. How do I get access to Steamworks? To get access to the Steamworks SDK, you still need to submit a demo of your game. All of our publicly available information is located here. If you have further questions you can contact steamworks@valvesoftware.com. 2. My game is in early development stages, don't I need to plan for the SDK integration now? The Steamworks SDK is easy to integrate, so you can wait until your game is further along in the development cycle before worrying about it. [/quote]
  15. Trouble Smoothly Moving Player Sprite

    You could try separating the movement from the key listener: [source lang="cpp"] // key event stuff addKeyListener(new KeyAdapter(){ public void keyPressed(KeyEvent ke){ if(ke.getKeyCode() == KeyEvent.VK_W){ bMoveUp = true; } if(ke.getKeyCode() == KeyEvent.VK_S){ bMoveDown = true; } if(ke.getKeyCode() == KeyEvent.VK_A){ bMoveLeft = true; } if(ke.getKeyCode() == KeyEvent.VK_D){ bMoveRight = true; } } public void keyReleased(KeyEvent ke){ if(ke.getKeyCode() == KeyEvent.VK_W){ bMoveUp = false; } if(ke.getKeyCode() == KeyEvent.VK_S){ bMoveDown = false; } if(ke.getKeyCode() == KeyEvent.VK_A){ bMoveLeft = false; } if(ke.getKeyCode() == KeyEvent.VK_D){ bMoveRight = false; } } public void keyTyped(KeyEvent ke){ } });[/source] [source lang="cpp"] // check if player is moving and set direction if (bMoveUp) setYDir(-1); [color=#000000] else if (bMoveDown) setYDir(1);[/color] [color=#000000] else setYDir(0);[/color] [color=#000000][font=Consolas,] if (bMoveLeft) setXDir(-1);[/font][/color] [color=#000000][font=Consolas,] else if (bMoveRight) setXDir(1);[/font][/color] [color=#000000] else setXDir(0);[/color] [/source]