Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

117 Neutral

About Askr

  • Rank
  1. Askr

    Which engine for 3D games using C#?

    Many people claim Unity to be slow under certain conditions (like using physics excessively), but it's probably still your best bet until you've got something more serious going on you're willing to pay a substantial amount for.
  2. Yeah, Kerbal Space Program is also quite playable already with career mode/science. Also the physics are way more realistic than in Space Engineers. :)
  3. Sorry, this doesn't work. It doesn't even compile due to syntax errors. That was my thought as well. Since you already made a GUI: How did you listen for the mouse? Did you add an own class for this or where did you put it?
  4. Sorry for being absent from this topic so long, but I came around testing all your input just now. :] Everything compiles well enough and I'm almost positive I didn't write anything too stupid, but somehow it just doesn't work. Let me paste some code and tell you what it does (and more importantly, what it does not): This is from my Program.cs - I spared out the parts I don't consider interesting (FillColor and the like). Window myWindow = new Window(50, 50, 400, 200); Button myButton = new Button(0, 0, 150, 25); myButton.setFillColor(new Color(255, 0, 0)); myButton.Click += new Action(myButton_Click); myWindow.Add(myButton); myWindow.Draw(); while (MainWindow.IsOpen()) { MainWindow.DispatchEvents(); MainWindow.Display(); } [...] static void myButton_Click() { Console.Write("foo"); } This is my button class public event Action Click; protected virtual void OnClick() { if (Click != null) Click(); } public Button(int x, int y, int w, int h) { this.X = x; this.Y = y; this.Width = w; this.Height = h; } When I run the program the window with a button inside of it pops up, but wherever I click, the corresponding method just isn't called. It came to me that I don't have anything defined yet that does any mouse handling, so I figured I have to do this first. Here however I'm at a loss again. :/ Right now I have this Class called "GuiItem" from which "Button" and "Window" inheret. Should I add MouseEventHandlers for keeping track of the mouse in there, or rather create something new?
  5. Gtk# is being used in games as well as other programs.[/quote] Is that so? I figured from a quick overview that it was not. Then I shall look into it some more.
  6. Wow, thanks guys! That's certainly some interesting stuff to work through. @NightCreature83 Thanks for explaining, I think I got it now! If I understood correctly delegates might be exactly what I've been looking for. @Khaiy I've put together a GUI using SFML 2.0 and C#, so if you'd like more information on what I did (which is functional, if inelegant) let me know.[/quote] Sure thing, hit me up with anything you got. I'd love to see how you did it. @Nypyren // Standard form button.Click += FunctionName;[/quote] I always did stuff like this. The first time I heard of lambda expressions was from your post and although I read the msdn article about lambda expressions by now I'm still a bit lost. You say I could use any of those forms, but do the prior ones do anything better than the standard form? @3Ddreamer Thanks for those links, but I was referring to GUIs in games. Although Gtk# looks promising I don't think I could find a use for it within my current project.
  7. Thanks for your fast reply. Although I don't quite understand how I can achieve the wanted functionality using delegates. :| Would you mind elaborating your solution some more?
  8. Hey there, so I've been trying to come up with a GUI (using SFML2.0 and C#) and while it's not really a problem to draw stuff onto the screen (or even checking if the mouse is above a button or if the button is clicked), I can't come up with an idea of how to make the buttons functional. I want to have a class called "Button" with a Property "ButtonFunction". So when I create a button I can also associate an action to be triggered, when I click the button. Can anyone give me a kickstart here? I'd also appreciate any other information regarding creating a useful custom GUI. Thanks in advance!
  9. Askr

    Game based on real-world time

    Thanks everyone for their answers. Many of this real-time games are server based. That is you have a server running the simulation all the time while the user can interact over a (web-)client with your game.[/quote] That's way out of scale regarding the simplicity of the game I want to create, though. The problem of simulating the gap, when starting a new game, can be solved by introducing several simulation layers. I.e when dealing with a village and the players did not play for a whole year, you don't need to simulate every single step of your peasants for one year. Start with a hi-level simulation (fred the peasant died this year, larry has been born recently) and go down once you reach the end, i.e. start a physics simulation of every npcs for the last several minutes.[/quote] That's quite an interesting thought, although it also sounds like a lot of work, or at least planning. I'll definitely be looking into it, so thanks for that input. Just ignore it, if you have a single player environment. If someone want to cheat, let him cheat.[/quote] Well, you're probably right about that. You need to seperate the simulation from the presentation and need to turn off everything which is only there to communicate the current state of your world to the player (audio,visuals).[/quote] You're of course right here. I shouldn't have put "sound" in there though, but explained what I meant with "events". I was thinking about choices the player could make if he was actually available on day X of the simulation, that would affect the simulation after day X. I'd either have to let these events trigger only when the game is actually running, or let an AI/randomly choose something for the player, I guess.
  10. Hej, so I've been wondering how you do this properly: I want to create a game very similar to the concept of a tamagotchi (I assume you're familiar with these creatures, if not scroll down for a breakdown*). This means you constantly have to track time and let your game character somehow react to it. While the game is running this seems to be no problem, but what happens if it's not? My approach to this would be to simply note the current time when exiting and subtract it from the current time when starting again, then using this difference to re-simulate all the missed events. As simple as this might sound I have some doubts about this being a professional (or at least practical) approach to this problem: 1) What happens if you don't start the game again for a really long time? Depending on the speed of the simulation and the machine it could result in a really long phase of re-simulating (is there a better word, btw?) and, in the worst case, appearing to be broken to the user. 2) The user could simply change the system time and provoke unwanted behaviour. How can you prevent this? 3) There would have to be a special method to re-simulate, since the usual simulation-method would play sounds and other events, that would be unwanted to be started multiple times when you race through the passed time. This could also result in other unwanted behaviour, or at least confusing the user. What's your input on this matter? Is it the right approach? Is there another way? The requirements are as following: - must not need internet access - must be able to shut down completely I'd be happy to read your thoughts and/or suggestions. PS: Sorry for my first post being a question topic. ;) * http://en.wikipedia....tchi#Life_Cycle
  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!