Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Ztormi

Pages: 1 2 3 [4] 5
46
DotNet / Re: Set sprite origin.
« on: November 20, 2014, 04:24:44 pm »
^^ Works fine.

(click to show/hide)

47
SFML projects / Re: Arcane, the roguelike
« on: November 18, 2014, 03:42:38 pm »
Love it! Needs some sounds though  ;D

48
DotNet / Re: SFML.Net GTK# Integration Questions
« on: November 17, 2014, 04:19:38 pm »
So I redownloaded Gwen.NET from repository and redid it again.

- Postbuild events were borked so I just removed them and copied the files from media directory into bin. CSFML-dlls were also missing so you might want to copy all sfml dlls while you are at it.
- Changed target platform to x86.
- UnitTest-project threw an exception because it couldn't find 2 font files which were not included in sources so I just replaced them from code ("Motorwerk" and "French Script MT").

49
DotNet / Re: Check if mousebutton was clicked (pressed, then released)
« on: November 17, 2014, 12:40:18 pm »
Use RenderWindow's MouseButtonReleased event.

50
DotNet / Re: SFML.Net GTK# Integration Questions
« on: November 17, 2014, 09:27:29 am »
Yes I did get them to work. I'll check when I get back home.

51
DotNet / Re: SFML.Net GTK# Integration Questions
« on: November 16, 2014, 11:44:57 am »
SFGUI is C++

I think Gwen.NET is pretty good and simple to use.

52
DotNet / Re: SFML Game Dev Guide - C++ to C# blockade
« on: November 14, 2014, 12:26:22 pm »
Browsing through this

Quote
Now...since the operator() method of AircraftMover isn't called explicit I'm sure that it's called within the AircraftMover Constructor. (Be sure that I'm not hip with C++ therefore I have to estimate what happens and relate it to C# designs).

...

How can the operator() method of AircraftMover receive any references to SceneNode and Time ? Since the AircraftMover Constructor isn't receiving any of these (only float_x and float_y parameters). Neither there is any inheritance to something which contains a SceneNode nor Time.


No, operator() is an operator overload. In this case it overloads call operation. You can also overload typical operations such as add or substract. Operator()-method is executed when you call aircraftmover instance. In the link I posted it's located in SceneNode-class.

void SceneNode::onCommand(const Command& command, sf::Time dt)
{
    // Command current node, if category matches
      if (command.category & getCategory())
          command.action(*this, dt);  

     // Command children
     FOREACH(Ptr& child, mChildren)
    child->onCommand(command, dt);
}
 

SceneNode and time are also passed to parameters there as you can see.

You can't overload call operator in C# so you'll have to handle that in a different way.
Here's a list of overloadable operators in C# http://msdn.microsoft.com/en-us/library/8edha89s.aspx

53
General discussions / Re: SFML's strong points?
« on: November 06, 2014, 11:36:28 am »
Coming from .NET world, SFML has absolutely superior performance compared to other C# graphics libraries I've used (not counting OpenTK ofc).

55
General / Re: Trying to Figure out how to show a new Window
« on: November 03, 2014, 12:22:25 pm »
does this help at all...?

snip...


Few things I noticed.

You are missing brackets from else clause:

             if (isFullScreen)
            {
                screenRes = VideoMode.DesktopMode;
                window = new RenderWindow(screenRes, "0", Styles.Fullscreen);
                windowencryipt = new RenderWindow(screenRes, "0", Styles.Fullscreen);
            }
            else
                window = new RenderWindow(screenRes, "0", Styles.Default);
                windowencryipt = new RenderWindow(screenRes, "0", Styles.Default);
           
Second while loop is never happening unless you close the first window, if you are going to render both of them you should do something like:
           
            while (Window.IsOpen() && WindowEncyript.IsOpen())
            {
                if (PreviousTick.Add(TickLength) <= DateTime.Now)
               {
                    Update();
                    Draw();
                }
             }
           
You are missing brackets in Update method so the second window always gets closed:

           
            if (Keyboard.IsKeyPressed(Keyboard.Key.Escape))
                window.Close();
                windowencryipt.Close();

Also not sure if you are aware of this but instead of writing
       
        private static Encryption encryption;
        public static Encryption Encryption
        {
            get { return encryption; }
        }

        private static RenderWindow window;
        public static RenderWindow Window
        {
            get { return window; }
            set { window = value; }
        }
You can just use
 
        public static Encryption Encryption {get; private set; }
        public static RenderWindow Window {get; set;}

56
General / Re: Starting on my first project!
« on: September 24, 2014, 10:36:13 am »
I kinda disagree you have to necessarily start with super simple projects like pong, pacman or snake. If you have a relatively simple idea in mind just go for it. Chances are you will fail miserably but the feeling of reward and achievement when you get to atleast some point with your own game is what keeps you going. Also the motivation to learn is usually a lot higher when you know you are making your own designed game.

I'd not worry about general architecture or design too much, just get to it and learn as you go. We've all been there.

57
DotNet / Re: Getting Crazy with them DateTime
« on: September 12, 2014, 02:08:52 pm »
Use
System.Diagnostics.Stopwatch
It's fine for the most applications.

Did you really not read my reply? There is a reason the SFML timing classes exist.

Just wanted to give him an option incase he doesn't want to mess around with git. For example the available nuget package doesn't have SFML.System namespace.

58
DotNet / Re: Getting Crazy with them DateTime
« on: September 12, 2014, 08:22:06 am »
Use
System.Diagnostics.Stopwatch
It's fine for the most applications.

59
Graphics / Re: Terrain questions: general approach, texture splatting, maps
« on: September 09, 2014, 01:12:33 pm »
To me it just looks like it's just splatting alpha channel textured quads with different layers.

Simple way to achieve this would be:

-Have all your quads or "splats" stored in collection(s).
-Add new quad to collection on mouseclick, you could detect if there's already quad added within certain radius so you can remove the old one.
-Create vertexarrays for each terraintype. Loop through your quads and add them to the corresponding vertexarray.
-Render all vertexarrays from bottom to top.

If you're a newbie I'd suggest you to ditch the vertexarrays and quads at first and implement the same functionality with Sprites first. After you've got the general idea how the thing works you could optimize it to use vertexarrays.


60
This is something I've been looking for. I'll have to try the .NET version out. Thanks for the binding!

I wasn't even aware of your earlier version  :-\

Pages: 1 2 3 [4] 5