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 7486 times)

eerr

  • Bay Watcher
    • View Profile
Re: ASCII Lab
« Reply #45 on: January 08, 2010, 04:28:02 pm »

Don't forget the Arm_Ok variable.
Logged

eerr

  • Bay Watcher
    • View Profile
Re: ASCII Lab
« Reply #46 on: January 10, 2010, 03:01:32 am »

Cancer of the colon has spread to become cancer of the indents
>.<

namespace, class,if, ifelse, for, if, if.
I count 7 there.
Code: [Select]
        static void ProcessInput()
        {
            int previousx=player.X;
            int previousy=player.Y;
            int dx=0;
            int dy=0;
            int dother = 0;


            // Is the player moving?
            if (gamestate >= 0) // changed to operate when key is
            {                   // released, bug, player can still hold more than one
                if (InputManager.IsPressed(Keys.Up))
                    keypressed_updown = 1;         
                else if (keypressed_updown == 1)
                { dy -= 1; keypressed_updown = 0; }

                if (InputManager.IsPressed(Keys.Down))
                    keypressed_updown = -1;
                else if (keypressed_updown == -1)
                { dy += 1; keypressed_updown = 0; }

                if (InputManager.IsPressed(Keys.Left))
                    keypressed_leftright = -1;
                else if (keypressed_leftright == -1)
                { dx -= 1; keypressed_leftright = 0; }

                if (InputManager.IsPressed(Keys.Right))
                    keypressed_leftright = 1;
                else if (keypressed_leftright == 1)
                { dx += 1; keypressed_leftright = 0; }
                if (InputManager.IsPressed(Keys.Enter))
                {
                    keypressed_leftright = 0;
                    keypressed_updown = 0;
                    keypressed_enter = 1;

                }
                else
                {
                    if (keypressed_enter > 0) { }

                    keypressed_enter = 0;
                    dother = 1;
                }





                if (dy == 0 & dx == 0 & dother == 0)
                {

                }
                else
                {


                    player.X += dx;
                    player.Y += dy;

                    goblin h;
                    for (int i = 0; i < goblins.Length; i++)// player kills goblins
                    {
                        h = goblins[i];

                       
                            if ((h.loc.X == player.X) & (h.loc.Y == player.Y))
                            {
                                h.setx(-1);
                                h.sety(-1);
                                h.alive = -1;
                                score++;
                            }
                       

                    }
                    //if ((x == playerx) & (y == playery))



                    // Keep the player on the screen
                    if (player.X < 0) player.X = 0;
                    else if (player.X * 16 > Video.width - 16) player.X = Video.width / 16 - 1;

                    if (player.Y < 0) player.Y = 0;
                    else if (player.Y * 16 > Video.height - 16) player.Y = Video.height / 16 - 1;


                    if (!(previousx - player.X == 0) || !(previousy - player.Y == 0))
                        gamestate = goblin.update(player.X, player.Y, goblins);
                }
            }

        }
     
    }/*

But anyway, All of the goblins now path towards the player. If the player moves onto the goblin, the goblin is killed.
If the goblin moves onto the player, the player dies.

Of course, the goblins can move diagonally while the player can't, so it's kinda unfair and impossible to win. But it works! god dam that was alot more work than I thought, but it works!
« Last Edit: January 10, 2010, 12:46:00 pm by eerr »
Logged

Willfor

  • Bay Watcher
  • The great magmaman adventurer. I do it for hugs.
    • View Profile
Re: ASCII Lab
« Reply #47 on: January 10, 2010, 12:02:58 pm »


Cancer of the colon has spread to become cancer of the indents
>.<
I'm not even sure where the indents are in my body. :(



 ;)
Logged
In the wells of livestock vans with shells and garden sands /
Iron mixed with oxygen as per the laws of chemistry and chance /
A shape was roughly human, it was only roughly human /
Apparition eyes / Apparition eyes / Knock, apparition, knock / Eyes, apparition eyes /

eerr

  • Bay Watcher
    • View Profile
Re: ASCII Lab
« Reply #48 on: January 10, 2010, 07:05:03 pm »

So lightman, you mentioned something about cooperating on a game?

I'ma go ahead and pursue that defense game right now.
« Last Edit: January 11, 2010, 04:28:30 pm by eerr »
Logged

Lightman

  • Bay Watcher
  • The groboclones are looking for you.
    • View Profile
Re: ASCII Lab
« Reply #49 on: January 11, 2010, 11:51:26 pm »

So lightman, you mentioned something about cooperating on a game?

Yeah, I started up a sourceforge repository. That might be the best way to organise it. We need a small group interested in the same idea and willing/able to contribute. The first thing to do would be to hash out the major goals and what-not. Right now, I'm just playing around with the code and trying some things. I think the siege game would be fun but I'd probably rather make an open-ended adventure/exploration game.
Logged

eerr

  • Bay Watcher
    • View Profile
Re: ASCII Lab
« Reply #50 on: January 12, 2010, 05:51:19 pm »

Why do you keep using the players location in terms of x +- 16?
I mean, I know it draws that directly to the screen at those positions, but is it really necessary?

Also, You won't be sharing code directly with me, which blows. Repurposing/reusing code is slow and barely worth it. Though as examples they work pretty well.


Though you seem intent on making code bits, so for suggestions:

Some code which moves the player with the numpad.
Some code which moves a purple worm around a screen.(nethack style)
An name input menu, both an example and something we can experiment with ourselves.
A snake that shoots venom( perhaps color-changing?) randomly
Creatures walk randomly, but are blocked by terrain features(trees and boulders) and other creatures.
The ability to make a line of terrain features from point x to point y.(walls and such)

« Last Edit: January 12, 2010, 07:15:49 pm by eerr »
Logged

Willfor

  • Bay Watcher
  • The great magmaman adventurer. I do it for hugs.
    • View Profile
Re: ASCII Lab
« Reply #51 on: January 12, 2010, 07:15:21 pm »

Why do you keep using the players location in terms of x +- 16?
I mean, I know it draws that directly to the screen at those positions, but is it really necessary?
Because it's a test/show project, and doesn't need a complicated tile setup. :P
Logged
In the wells of livestock vans with shells and garden sands /
Iron mixed with oxygen as per the laws of chemistry and chance /
A shape was roughly human, it was only roughly human /
Apparition eyes / Apparition eyes / Knock, apparition, knock / Eyes, apparition eyes /

eerr

  • Bay Watcher
    • View Profile
Re: ASCII Lab
« Reply #52 on: January 12, 2010, 09:39:49 pm »

Ugh, It was a typo.

creature vs
Creature

I also have a duplicate entry or something.
« Last Edit: January 13, 2010, 12:22:01 am by eerr »
Logged

Lightman

  • Bay Watcher
  • The groboclones are looking for you.
    • View Profile
Re: ASCII Lab
« Reply #53 on: January 13, 2010, 12:41:31 am »

Because it's a test/show project, and doesn't need a complicated tile setup. :P

What Willfor said.

Also, You won't be sharing code directly with me, which blows. Repurposing/reusing code is slow and barely worth it. Though as examples they work pretty well.

Though you seem intent on making code bits, so for suggestions:

I don't understand what you mean, here?
Logged

eerr

  • Bay Watcher
    • View Profile
Re: ASCII Lab
« Reply #54 on: January 13, 2010, 12:56:23 am »

Ehhh, Forget it.
I'm in ur library, usin ur code.
« Last Edit: January 13, 2010, 01:21:44 am by eerr »
Logged

Lightman

  • Bay Watcher
  • The groboclones are looking for you.
    • View Profile
Re: ASCII Lab
« Reply #55 on: January 13, 2010, 10:37:43 pm »

Ehhh, Forget it.
I'm in ur library, usin ur code.

Mah lib iz n ur cpuz... stealin' ur cyclz
Logged

eerr

  • Bay Watcher
    • View Profile
Re: ASCII Lab
« Reply #56 on: January 13, 2010, 11:55:26 pm »

I still don't know what game I'm making.

Or what you are making.


I also feel obsessive with almost half the posts in the thread.

We need to chat on msn or something.
« Last Edit: January 14, 2010, 02:18:08 am by eerr »
Logged

Willfor

  • Bay Watcher
  • The great magmaman adventurer. I do it for hugs.
    • View Profile
Re: ASCII Lab
« Reply #57 on: January 14, 2010, 10:30:15 pm »

And then ASCII Lab became an easily modifiable high-end console emulator.

Spoiler (click to show/hide)

My mouse doesn't show up, but it's there.
Logged
In the wells of livestock vans with shells and garden sands /
Iron mixed with oxygen as per the laws of chemistry and chance /
A shape was roughly human, it was only roughly human /
Apparition eyes / Apparition eyes / Knock, apparition, knock / Eyes, apparition eyes /

eerr

  • Bay Watcher
    • View Profile
Re: ASCII Lab
« Reply #58 on: January 15, 2010, 12:10:29 am »

I've got code that draws a wall between two points.

With the hours of debugging it took to make that work, I'm not inclined to make the line shaped nicer, or avoid tacking on the end pts.

It works as long as the points aren't equal.
« Last Edit: January 15, 2010, 12:33:21 am by eerr »
Logged

Lightman

  • Bay Watcher
  • The groboclones are looking for you.
    • View Profile
Re: ASCII Lab
« Reply #59 on: January 15, 2010, 12:11:39 am »

And then ASCII Lab became an easily modifiable high-end console emulator.

My mouse doesn't show up, but it's there.

You need the background black and green text.

eerr
Yes, we'll chat.
Logged
Pages: 1 2 3 [4] 5