Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

119 Neutral

About JoeShanahan

  • Rank
  1. I don't complain about much on here, but hash tagging on facebook is fucking retarded.
  2. JoeShanahan

    Have done XNA/C#, what's next?

    I have known about Monogame for a while and it did look interested, however the majority of my coding knowledge has been gained through using XNA it seemed very overwhelming to use since there is not proper documentation for beginners like there is for XNA.   Also, the last time I queried that line thought they suggested to build your game within XNA/Visual Studio and just port it over (HOW you did that wasn't obvious); is that not a good thing to do anymore?
  3. I spent a good deal of time developing a game concept with XNA/C#; however, since I have lost the all the files (made a mistake using Dropbox on many computers!) and with the recent anouncement that XNA is not longer supported by microsoft... I was just wondering what you think I should try next?   I have had a few glances at JAVA with LWJGL and the syntax seemed very close to C# (if not identical) but with everyone saying C++ is 'harder', maybe it would be a good experience to try that?   Thanks for your time, I'm sure you get these kinds of questions all of the time :P
  4. JoeShanahan

    XNA custom gamepads in Visual Studio

    Use SlimDX's direct input library, you access the joystick like so: [source lang="csharp"] Joystick joystick; int joystickButtonCount; int joystickAxesCount; JoystickState joystickState, oldJoystickState; public Game() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; CreateDevice(); } ... protected override void Update(GameTime gameTime) { joystickState = joystick.GetCurrentState(); bool[] buttons = joystickState.GetButtons(); Console.Clear(); Console.WriteLine("Using device: {0}\nButton count: {1}\nAxes count: {2}\n", joystick.Information.ProductName, joystickButtonCount, joystickAxesCount); for (int i = 0; i < joystickButtonCount; i++) { Console.WriteLine("{0}: {1}", i + 1, buttons); } } void CreateDevice() { DirectInput dinput = new DirectInput(); foreach (DeviceInstance device in dinput.GetDevices(DeviceClass.GameController, DeviceEnumerationFlags.AttachedOnly)) { try { joystick = new Joystick(dinput, device.InstanceGuid); joystickAxesCount = joystick.Capabilities.AxesCount; joystickButtonCount = joystick.Capabilities.ButtonCount; break; } catch { } } if (joystick == null) { Console.WriteLine("No devices"); return; ; } joystick.Acquire(); foreach (DeviceObjectInstance deviceObject in joystick.GetObjects()) { if ((deviceObject.ObjectType & ObjectDeviceType.Axis) != 0) joystick.GetObjectPropertiesById((int)deviceObject.ObjectType).SetRange(-1000, 1000); } } [/source] Getting your axis information is a little different, if you do joystickState{dot} intellisense will show you a lot of properties, the ones with X, Y and Z on the end will give you your axis info, so to find out which one your joystick uses you'll have to print them all the console and see. EDIT: These two lines: joystickAxesCount = joystick.Capabilities.AxesCount; joystickButtonCount = joystick.Capabilities.ButtonCount; may cause you to hang for a few seconds, so you may want to create your device on a seperate thread so your main game loop won't stall until it responds. You could also cut this out entirely and loop over the entire bool[] buttons array which I think is of size 128.
  5. JoeShanahan

    Achieving oldschool platformer physics

    Whilst looking for the exact same thing yourself, I came across Wildybunny's tutorials but find they didn't suit my needs because I wanted to have slopes that responded correctly. What I ended implementing was something called SAT (Seperate axis theorem), which is probably half of what Box2D uses, just without accounting for friction, gravity, acceleration etc. for a full blown rigid body simulator. If you want to have a crack at doing this, I used the tutorials on the following youtube video (description): [media][/media] I actually think these are originally hosted on here somewhere, but this is where I found them. The only problem I can foresee of going down this route is that if you haven't got a grasp of the theory itself, trying to debug any thing, or expand upon the system for your needs will be hard if not impossible. Edit: I don't know what language/framework you are using as I have never really looked properly at Box2D, I only know what it does. These tutorials were meant for C++, but I was able to implement it into C#/XNA without much trouble even though I have never learnt C++.
  6. I'm currently messing around with SlimDX's DirectInput for my XNA game with my own device. The device has 4 axes (for some reason Joystick. Capabilities.AxesCount gives 6, any idea why?) and I can access 3 of the 4 by using the .X, .Y and .Z properties of the JoystickState. How would I go about using the 4th axis as well? Is it possible to scan ALL available axes and just dump them into a Vector2[] to make it easier to read from them? Thanks!
  7. 6 visits later and 2 new phones I finally have a working desire hd again... just kidding, they gave me the wrong battery. -_-
  • 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!