Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

ByteTroll

Member Since 13 Sep 2012
Offline Last Active Yesterday, 10:12 PM
-----

Posts I've Made

In Topic: Linux for development Windows games - how do it

13 May 2013 - 10:46 AM

I was forced to do this one time as an educational experience, and while I was able to do it, the amount of hassle that came along with it was unreal.  The best advice (assuming you have a windows box) is to program the windows specific code on native Windows.  Regardless, you are going to have to use a toolchain that supports the ".exe" file.  This is best done natively on Windows, but you might be able to use 'W.I.N.E' or something similar.

 

If you are using libraries that are cross-platform, and assuming you stick to cross-platform code, it should be as easy as just compiling on the new platform (I use the phrase "should be" lightly).

 

Do you have any Windows box at all?  It can be troublesome to develop for a platform you can't test on.

 

I missed this the first time, but this is a very real and valid point.  It is not good practice to test a game that you want to natively port to Windows in something like "W.I.N.E."  You really want a native system to test on.

@EDIT: Added to original answer.


In Topic: Is this bad?

06 May 2013 - 09:41 PM

Two maxims: Programmers should never repeat themselves, and magic numbers are bad.

 

 

Create a function to snap to a tile.  Perhaps use the signature Vector2F SnapToTile(Vector2F source) { }.

 

Second, rather than using the constant 64, instead use a static const int defined in a header file somewhere.

 

 

Your version will always snap to the nearest border, and perhaps someday you would rather the function snap to the nearest tile boundary.

 

Your way of doing things is not bad, but Frob's way will probably work better in the long run.  Quickly adding to Frob's answer, I would poll the values from somewhere.  Most editors have a drop down menu that lets you select snapping values.


In Topic: Sharing gameobjects, variables, strings between scripts

05 May 2013 - 07:54 PM

It's been a bit since I have had to use C#, but you should use class/struct accessors.  Here is a code snippet:

 

Say we have a level and a player.  The player class contains a position variable.  Stuff needs to know about the players position, so, you would do something like this:

 

Vector2 position;
public Vector2 Position
 {
     get
     {
         return (position);
     }
     set
     {
         position = value;
     }
  }
 

If you need to get/set the variable from another class, just use the accessor.

 

@EDIT: Cleaned up original post and made reply more clear.


In Topic: Understanding PyMMO

23 April 2013 - 12:42 PM

Thok has a very good point and I will add on to it quick!  You need to learn how to read and understand code yourself.  Half of being a programmer is being able to read and understand other peoples code and follow logic.  As Thok said, you are more likely to get help if you ask about a specific block of code or system.


In Topic: Article Monthly Themes

28 March 2013 - 06:59 AM

Personally, I think having a theme every month could make things fun and interesting.  It would be nice to see some topics that aren't generally covered such as advanced rendering techniques, memory management, etc.  I also like the idea of the "remake the classics" theme.


PARTNERS