Author Topic: CalcInterface for XNA  (Read 3051 times)

0 Members and 1 Guest are viewing this topic.

Offline BlakPilar

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 734
  • Rating: +44/-1
    • View Profile
CalcInterface for XNA
« on: November 10, 2011, 07:57:31 pm »
As I'm sure a lot of people know, Microsoft has a game development platform for .NET called XNA. I'm not one for long descriptions or essay writing, so I'll just get to the main point; I've made a library for XNA in C# that allows for creation of games that will look like those on the calculator but with full access to the speed of a computer. It has all of the main functions that I'm aware of that are mainly used in game development on the calculator with the exception of lists (they are easily accessed using System.Collections.Generic.List<T>). This includes calc-like text support, sprites (8x8, just like Axe), pictures, and both the home and graph screens.

Before I released this I was going to make a full port of Builderboy's Portal. However, because of BexIDE and other things such as school, I haven't been able to work on it much (sorry, Builderboy). I have, however, been able to put together a fun little program that uses the interface in a cellular automata program. I've attached the entire project so you can view the source and see how it works, or if you just want to play with the program and have .NET 4.0 installed you can do so ;) I've tried to document everything in the library source itself, but if you need any questions answered, feel free to ask them here.

I don't guarantee that the code is 100% optimized, but I've done what I can. I'll be updating this as time goes on (I plan on adding grayscale) so if you feel like it, be sure to keep an eye out.

To use this in another project, simply right click on your project, go to Add > Existing Item, and locate where you placed CalcInterface.cs. Anywhere you want to use it make sure you add "using Betafy;" to the top of the code, or just do "Betafy.CalcInterface <name>" when you declare it. Whichever floats your boat.

If you're playing around with the program I included, ENTER changes from Sandbox to Editing mode, SPACE pauses, left clicking while in SandBox creates particles and in Editing it adds walls, right clicking in Editing mode erases a pixel, and scrolling increases/decreases the brush size. The program itself is by no means perfect, but it's pretty fun to play around with.

Cellular automata demo:

And if you look at the source, congratulations. You now know my name :P
« Last Edit: November 10, 2011, 07:57:51 pm by BlakPilar »

Offline C0deH4cker

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 258
  • Rating: +11/-1
    • View Profile
    • iNinjas Forum/Repo
Re: CalcInterface for XNA
« Reply #1 on: November 10, 2011, 08:06:54 pm »
This is really neat! Ive used xna before, but never made anything like this. Now you just have to make it emulate the z80 processor so it can run compiled axe programs :P

Offline BlakPilar

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 734
  • Rating: +44/-1
    • View Profile
Re: CalcInterface for XNA
« Reply #2 on: November 10, 2011, 08:13:04 pm »
Thanks! :D But no, it's not an emulator lol. You write the code and Visual Studio compiles it into a .NET app :P it does support sprites like Axe, though...

Offline C0deH4cker

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 258
  • Rating: +11/-1
    • View Profile
    • iNinjas Forum/Repo
Re: CalcInterface for XNA
« Reply #3 on: November 10, 2011, 08:20:18 pm »
Cool. Ill have to check it out.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: CalcInterface for XNA
« Reply #4 on: November 19, 2011, 02:34:40 pm »
Hmm interesting. I remember Miotatsu did something similar for the computer, but sadly he stopped working on it after he lost his progress. It was called BasiC++ IIRC.