«12. . .84858687888990. . .9293»
Da system ID
It no work
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
///█ ■
////https://www.youtube.com/watch?v=SGZgvMwjq2U
namespace Snake
{
class Program
{
static void Main(string[] args)
{
Console.WindowHeight = 16;
Console.WindowWidth = 32;
int screenwidth = Console.WindowWidth;
int screenheight = Console.WindowHeight;
Random randomnummer = new Random();
int score = 5;
int gameover = 0;
pixel hoofd = new pixel();
hoofd.xpos = screenwidth/2;
hoofd.ypos = screenheight/2;
hoofd.schermkleur = ConsoleColor.Red;
string movement = "RIGHT";
List<int> xposlijf = new List<int>();
List<int> yposlijf = new List<int>();
int berryx = randomnummer.Next(0, screenwidth);
int berryy = randomnummer.Next(0, screenheight);
DateTime tijd = DateTime.Now;
DateTime tijd2 = DateTime.Now;
string buttonpressed = "no";
while (true)
{
Console.Clear();
if (hoofd.xpos == screenwidth-1 || hoofd.xpos == 0 ||hoofd.ypos == screenheight-1 || hoofd.ypos == 0)
{
gameover = 1;
}
for (int i = 0;i< screenwidth; i++)
{
Console.SetCursorPosition(i, 0);
Console.Write("■");
}
for (int i = 0; i < screenwidth; i++)
{
Console.SetCursorPosition(i, screenheight -1);
Console.Write("■");
}
for (int i = 0; i < screenheight; i++)
{
Console.SetCursorPosition(0, i);
Console.Write("■");
}
for (int i = 0; i < screenheight; i++)
{
Console.SetCursorPosition(screenwidth - 1, i);
Console.Write("■");
}
Console.ForegroundColor = ConsoleColor.Green;
if (berryx == hoofd.xpos && berryy == hoofd.ypos)
{
score++;
berryx = randomnummer.Next(1, screenwidth-2);
berryy = randomnummer.Next(1, screenheight-2);
}
for (int i = 0; i < xposlijf.Count(); i++)
{
Console.SetCursorPosition(xposlijf[i], yposlijf[i]);
Console.Write("■");
if (xposlijf[i] == hoofd.xpos && yposlijf[i] == hoofd.ypos)
{
gameover = 1;
}
}
if (gameover == 1)
{
break;
}
Console.SetCursorPosition(hoofd.xpos, hoofd.ypos);
Console.ForegroundColor = hoofd.schermkleur;
Console.Write("■");
Console.SetCursorPosition(berryx, berryy);
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("■");
tijd = DateTime.Now;
buttonpressed = "no";
while (true)
{
tijd2 = DateTime.Now;
if (tijd2.Subtract(tijd).TotalMilliseconds > 500) { break; }
if (Console.KeyAvailable)
{
ConsoleKeyInfo toets = Console.ReadKey(true);
//Console.WriteLine(toets.Key.ToString());
if (toets.Key.Equals(ConsoleKey.UpArrow) && movement != "DOWN" && buttonpressed == "no")
{
movement = "UP";
buttonpressed = "yes";
}
if (toets.Key.Equals(ConsoleKey.DownArrow) && movement != "UP" && buttonpressed == "no")
{
movement = "DOWN";
buttonpressed = "yes";
}
if (toets.Key.Equals(ConsoleKey.LeftArrow) && movement != "RIGHT" && buttonpressed == "no")
{
movement = "LEFT";
buttonpressed = "yes";
}
if (toets.Key.Equals(ConsoleKey.RightArrow) && movement != "LEFT" && buttonpressed == "no")
{
movement = "RIGHT";
buttonpressed = "yes";
}
}
}
xposlijf.Add(hoofd.xpos);
yposlijf.Add(hoofd.ypos);
switch (movement)
{
case "UP":
hoofd.ypos--;
break;
case "DOWN":
hoofd.ypos++;
break;
case "LEFT":
hoofd.xpos--;
break;
case "RIGHT":
hoofd.xpos++;
break;
}
if (xposlijf.Count() > score)
{
xposlijf.RemoveAt(0);
yposlijf.RemoveAt(0);
}
}
Console.SetCursorPosition(screenwidth / 5, screenheight / 2);
Console.WriteLine("Game over, Score: "+ score);
Console.SetCursorPosition(screenwidth / 5, screenheight / 2 +1);
}
class pixel
{
public int xpos { get; set; }
public int ypos { get; set; }
public ConsoleColor schermkleur { get; set; }
}
}
}
//¦
I am now a card!
Lemon 42 and Kashyyyyyyyk
~~TEXT~~
%%Response%%
~~TEXT~~
I wonder how Testlandias' thanksgiving was
Does this region test things anymore?
Dunno! Let's test it.
Testlandia, Lemon 42, and Right Hand Man
Dead RMB
Test.
Very on-brand.
Retest, because why not.
Yes.
Test for search.
Test for search hippopotamus.
Lemon 42 and -I ShipIt-
It's me, me, me, I am more than what you see
Thanks :)
Test for search giraffe.
Just how hard to find can such large animals be?
Lemon 42 and Snoopers
Yeah! What's next, an elephant?
Probably.
Jennifer Government was a great book. I highly recommend it. But don't take my word for it. Take a look, in a book...
You know what would be a cool add-on to this game?
If nations could at some number of citizens declare a national language.
Like we get to change our capitals, religion, leader etc. in the settings page. ☺
or an implemented map system to make RP a little easier, along with econ and military stats
«12. . .84858687888990. . .9293»
Advertisement