SharpDevelop 3.2+ Dark GDK.net

Hello everyone,

I’m here to tell I was trying to make DLL files for Dark GDK.net and put them on Dark Dasic and Pro version.

I will give here a code snippet for example. BTY I got the project successful. I will give my code template for C# here as a community driven.

The project must be upgraded from 2008. For instance I will show on 2015 Community Edtion too.

Every time everyone needs to create a new code template, you should call references inside c# vesion.

For instance DarkGDK, DGDKLib. You must make to get the code done and built.

I’m here to help. So, any doubt I will try to give an answer soon as possible.

 

Code Snippet Cllass1.cs:
/* Criado por SharpDevelop.
* Utilizador: astro
* Data: 19/02/2017
* Hora: 16:52
*
* Para alterar este modelo usar Ferramentas | Opções | Código | Alterar Cabeçalhos Standard
*/
using System;

namespace GDKCs.Properties
{
/// <summary>
/// Description of Class1.
/// </summary>
public class Class1
{
//variables
private static Boolean LeftMouseDown;
private static Boolean[] KeyDown = new Boolean[104];
private static int lastScanCode;

public static void SetupKeyEvents() // Must be called once before any of the following functions
{

for (int i = 0; i <= KeyDown.Length; i++)
KeyDown[i] = false;
}
public static Boolean SingleKeyPress(DarkGDK.IO.Keys kKey)
{

if (DarkGDK.IO.Keyboard.State(kKey) && !KeyDown[DarkGDK.IO.Keyboard.ScanCode])
{
KeyDown[DarkGDK.IO.Keyboard.ScanCode] = true;
lastScanCode = DarkGDK.IO.Keyboard.ScanCode;
return true;
}
else if (DarkGDK.IO.Keyboard.ScanCode == 0) // Means we aren’t pressing any key 🙂
{
KeyDown[lastScanCode] = false;
return false;
}
else
return false;
}

public static Boolean SingleLeftClick()
{
if (DarkGDK.IO.Mouse.LeftClick && !LeftMouseDown)
{
LeftMouseDown = true;
return true;
}
else if (!DarkGDK.IO.Mouse.LeftClick)
{
LeftMouseDown = false;
return false;
}
return false;
}

public void NGame(){

}

public void LGame()
{

}

public void OGame()
{
}
public void OptGame()
{
}
public void qGame(){
System.Environment.Exit(1);
}

public void Menu()
{
do
{
int c = 1;
switch(c){
case ‘1’: Console.Write(“New Game\n”);
break;
case ‘2’: Console.Write(“Load Game\n”);
break;
case ‘3’: Console.Write(“Online Game\n”);
break;
case ‘4’: Console.Write(“Options\n”);
break;
case ‘5’: qGame();
break;
default: Console.Write(“Error… Quitting\n”);
break;
}

}while(true);

}

public Class1()
{
}
}
}

example

example_referenceT

 

Thank you so much.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

Up ↑

%d bloggers like this: