GameTestLib/Tetris/Game.mq5

58 lines
2.2 KiB
MQL5
Raw Permalink Normal View History

2025-11-14 17:18:48 -05:00
//+------------------------------------------------------------------+
//| Game.mq5 |
//| Copyright 2025, Niquel Mendoza. |
//| https://www.mql5.com/es/users/nique_372/news |
//+------------------------------------------------------------------+
#property copyright "Copyright 2025, Niquel Mendoza."
#property link "https://www.mql5.com/es/users/nique_372/news"
#property version "1.00"
#property strict
#include "Main.mqh"
CTetrisGame game;
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- create timer
2025-11-14 20:55:53 -05:00
game.Init(650, 350, 150, ColorToARGB(clrSlateGray), ColorToARGB(clrGainsboro), 15);
2025-11-14 17:18:48 -05:00
game.Run();
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//--- destroy timer
game.OnDeinitEvent(reason);
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
//---
}
//+------------------------------------------------------------------+
//| Timer function |
//+------------------------------------------------------------------+
void OnTimer()
{
//---
game.OnTimerEvent();
}
//+------------------------------------------------------------------+
//| ChartEvent function |
//+------------------------------------------------------------------+
void OnChartEvent(const int32_t id,
const long &lparam,
const double &dparam,
const string &sparam)
{
//---
game.ChartEvent(id, lparam, dparam, sparam);
}
//+------------------------------------------------------------------+