Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 [3] 4 5

Author Topic: ASCII Lab  (Read 7471 times)

Normandy

  • Bay Watcher
    • View Profile
Re: ASCII Lab
« Reply #30 on: January 06, 2010, 07:59:31 pm »

Operating overloading is only for basic operators such as +, -, ==, !=, etc...

If you did not know that, I'm pretty sure you shouldn't be worrying about that.

Just deal with it, mostly. It's five characters more, surely no impediment on productivity.

Also, it should be noted that you shouldn't do operating overloading on primitives like numbers in the first place, if it's actually possible.
Logged

eerr

  • Bay Watcher
    • View Profile
Re: ASCII Lab
« Reply #31 on: January 06, 2010, 08:10:55 pm »

someone write me a gui with a goddam macro.
We're doing this, we can make c# absolutely better than Java.
When it is time to write code.

Ok, compromise, I can get java style with commonly used functions
by wrapping them up in a shorter function, and supposedly the compiler optimises to the same result as if I just typed out the dam thing by hand. Supposedly.
Logged

Lightman

  • Bay Watcher
  • The groboclones are looking for you.
    • View Profile
Re: ASCII Lab
« Reply #32 on: January 07, 2010, 12:49:09 am »

...by wrapping them up in a shorter function, and supposedly the compiler optimises to the same result as if I just typed out the dam thing by hand. Supposedly.

You can do it that way, if it really matters. I'd suggest some simple, static wrapper. When you get towards 'release' code you could always just do a search/replace and add 'Math.' to everything. By the way, I think the non-Express version of Visual Studio supports macros.

I uploaded some sample code for people to try (classes for you, Hippoman? :)). See the original post.
Logged

eerr

  • Bay Watcher
    • View Profile
Re: ASCII Lab
« Reply #33 on: January 07, 2010, 02:07:25 am »

It complains about importing Grobo,

"GraphicsManager" does not exist in this context.

There is also a GroboLib that has a little exclamation point.
Logged

Lightman

  • Bay Watcher
  • The groboclones are looking for you.
    • View Profile
Re: ASCII Lab
« Reply #34 on: January 07, 2010, 04:11:13 am »

It complains about importing Grobo,

"GraphicsManager" does not exist in this context.

There is also a GroboLib that has a little exclamation point.

That means it can't find the DLL. It's in the zip file. Did you follow the installation instructions? To use the demo code, you start a new ASCII Game project and add those files (replace Program.cs).
« Last Edit: January 07, 2010, 04:13:28 am by Lightman »
Logged

eerr

  • Bay Watcher
    • View Profile
Re: ASCII Lab
« Reply #35 on: January 07, 2010, 05:00:10 am »

Read to me the exact files you have in that directory.

I have tried both just extracting the first zip, and extracting both.
No diffrence.
Logged

Alexhans

  • Bay Watcher
  • This is toodamn shortto write something meaningful
    • View Profile
    • Osteopatia y Neurotonia
Re: ASCII Lab
« Reply #36 on: January 07, 2010, 12:05:37 pm »

I haven't downloaded and installed last SP of .NET yet but I'm already checking out C#'s features.

So far... I like it very much.

Small details like not having to care about argument order made my day:
Code: [Select]
System.Console.WriteLine("What do you know? {1} contains {0}",sss,eee);sss and eee are strings, btw.
Logged
“Eight years was awesome and I was famous and I was powerful" - George W. Bush.

Berserker

  • Bay Watcher
    • View Profile
Re: ASCII Lab
« Reply #37 on: January 07, 2010, 12:10:14 pm »

Also, if you want a major time waster,
 look into "An Untitled Story".

I tried this yesterday, and it messed up my computer totally. I had to reinstall my computer's operating system.
Logged

Lightman

  • Bay Watcher
  • The groboclones are looking for you.
    • View Profile
Re: ASCII Lab
« Reply #38 on: January 07, 2010, 12:13:22 pm »

Read to me the exact files you have in that directory.

I have tried both just extracting the first zip, and extracting both.
No diffrence.

I must have missed something for the template. Annoying. Anyway, just expand the references, remove Grobo and then add it manually: right-click on references, choose add, select the browse tab and locate the DLL. That should do it.
Logged

Berserker

  • Bay Watcher
    • View Profile
Re: ASCII Lab
« Reply #39 on: January 07, 2010, 12:48:04 pm »

This is kind of hard to explain, but is there a function that prints text in the same way the BlitASCII prints a character?
BlitASCII uses the 16x16 characters and DrawText uses it's own font.

So I'm looking for a function that prints the text with the 16x16 characters.


Edit: Nevermind, I made my own function:

Code: [Select]
public static void DrawASCIIText(int x, int y, string txt, Color col) {
    x *= 16; y *= 16;
    int drawPos = 0;
    foreach(char c in txt) {
        GraphicsManager.BlitASCII(x+drawPos, y, (byte)c, col);
        drawPos += 16;
    }
}

« Last Edit: January 07, 2010, 12:59:52 pm by Berserker »
Logged

Lightman

  • Bay Watcher
  • The groboclones are looking for you.
    • View Profile
Re: ASCII Lab
« Reply #40 on: January 07, 2010, 04:35:08 pm »

This is kind of hard to explain, but is there a function that prints text in the same way the BlitASCII prints a character?
BlitASCII uses the 16x16 characters and DrawText uses it's own font.

I understand. The point is that BlitASCII is just using a set of bitmap tiles and DrawText is using a true-type font. Ie. the former is intended to create game graphics and the latter is for text output. However, you can obviously use the ASCII table for text, too, as per the function you wrote ;)
Logged

eerr

  • Bay Watcher
    • View Profile
Re: ASCII Lab
« Reply #41 on: January 07, 2010, 11:59:41 pm »

My first challenge shall be:
Implementation of g's that march on the player.
The player can only kill one per turn, and any goblin can kill the player.

In the process, I will use structs and such.


Edit: or maybe I will be simple and use objects...
« Last Edit: January 08, 2010, 11:03:47 am by eerr »
Logged

Lightman

  • Bay Watcher
  • The groboclones are looking for you.
    • View Profile
Re: ASCII Lab
« Reply #42 on: January 08, 2010, 12:00:44 pm »

Edit: or maybe I will be simple and use objects...

Classes (that's what you mean by 'objects', right?) would make more sense, probably, for what you are doing.
« Last Edit: January 08, 2010, 12:03:53 pm by Lightman »
Logged

eerr

  • Bay Watcher
    • View Profile
Re: ASCII Lab
« Reply #43 on: January 08, 2010, 01:26:23 pm »

Edit: or maybe I will be simple and use objects...

Classes (that's what you mean by 'objects', right?) would make more sense, probably, for what you are doing.
Classes, because objects are much more convenient than goblin structures.
« Last Edit: January 08, 2010, 02:05:54 pm by eerr »
Logged

Berserker

  • Bay Watcher
    • View Profile
Re: ASCII Lab
« Reply #44 on: January 08, 2010, 02:43:15 pm »

Now I have goblins running around and a dwarf that you can control, next I am going to do combat things and consider adding body parts.
Logged
Pages: 1 2 [3] 4 5