Giter VIP home page Giter VIP logo

gamevision's Introduction

GameVision Logo

Chat on Discord GitHub stars GitHub Watchers GitHub forks Twitter Follow

Overview

GameVision Toolkit™ is 2D indie SDK that allow you to do game development in Delphi for desktop PC's running Microsoft Windows® and uses Direct3D® for hardware accelerated rendering.

It's robust, designed for easy, fast & fun use an suitable for making all types of 2D games and other graphic simulations, You access the features from a simple and intuitive API, to allow you to rapidly and efficiently develop your projects. There is support for bitmaps, audio samples, streaming music, video playback, loading resources directly from a standard ZIP archive, a thin object oriented actor/scene system, entity state machine, sprite management, PolyPoint™ collision detection and much more. GameVision, easy, fast & fun!

Downloads

Development - This build represent the most recent development state an as such may or may not be as stable as the official release versions. If you like living on the bleeding edge, it's updated frequently (often daily) and will contain bug fixes and new features.

Releases - These are the official release versions and deemed to be the most stable.

Features

  • Free and open source
  • All required libraries are bundled in GameVision (Allegro, Nulkear, CSFMLAudio, LuaJIT)
  • Written in Object Pascal
  • Support Windows 32/64 bit platforms
  • Support Delphi Community Editions (Windows 32-bit only)
  • Hardware accelerated with Direct3D
  • You interact with the toolkit via routines, class objects and a thin OOP framework
  • Archive (mount/unmount, ZIP format )
  • Display ( Direct3D, antialiasing, vsync, viewports, primitives, blending)
  • Input (keyboard, mouse and joystick)
  • Bitmap (color key transparency, scaling, rotation, flipped, titled, BMP, DDS, PCX, TGA, JPEG, PNG)
  • Video (play, pause, rewind, OGV format)
  • Sprite (pages, groups, animation, polypoint collision)
  • Entity (defined from a sprite, position, scale, rotation, collision)
  • Actor (list, scene, statemachine)
  • Audio (samples, streams, WAV, OGG/Vorbis, FLAC formats)
  • Speech (multiple voices, play, pause)
  • Font (true type, scale, rotate, 2 builtin)
  • Timing (time-based, frame elapsed, frame speed)
  • Scripting (load, save, easy manual binding to Pascal, FFI from script)
  • Shaders (vertex, pixel, HLSL)
  • Misc (screenshake, screenshot, starfied, colors, ini based config files, startup dialog, treeview menu)

Minimum System Requirements

How to use in Delphi

  • Unzip the archive to a desired location.
  • Add installdir\sources, and all the installdir\deps\xxx folders to Delphi's library path so the toolkit source files can be found for any project or for a specific project add to its search path.
  • See examples in the installdir\examples for more information about usage. You can load all projects using the GameVision Toolkit Projects group file located in the installdir\sources folder.
  • Build GVArc utility for making .ARC files (standard zip archives). Running the makearc.bat in installdir\bin will build Data.arc that is used by the examples.
  • Build GVDump utiltiy if you need convert a small binary file to Pascal source format that can be included {$I MyBinaryFile.inc} in your project.
  • Build GVExamples to showcase many of the features and capabilities of the toolkit.

Known Issues

  • This project is in active development so changes will be frequent
  • Documentation is WIP. They will continue to evolve
  • More examples will continually be added over time

A Tour of GameVision

Game Object

You just have to derive a new class from the TCustomGame base class and override a few callback methods. You access the toolkit functionality from the classes in the various GameVision.XXX units.

uses
  GameVision.Common,
  GameVision.Audio,
  GameVision.Graphics,
  GameVision.Input,
  GameVision.System,
  GameVision.UI,
  GameVision.Game;
  
const
  cArchiveFilename   = 'Data.arc';

  cDisplayTitle      = 'MyGame';
  cDisplayWidth      = 800;
  cDisplayHeight     = 480;
  cDisplayFullscreen = False;

type
  { TMyGame }
  TMyGame = class(TCustomGame)
  protected
    FFont: TFont;
  public
    procedure OnLoad; override;
    procedure OnExit; override;
    procedure OnStartup; override;
    procedure OnShutdown; override;
    procedure OnUpdate(aDeltaTime: Double); override;
    procedure OnClearDisplay; override;
    procedure OnShowDisplay; override;
    procedure OnRender; override;
    procedure OnRenderHUD; override;
  end;

How to use

A minimal implementation example:

uses
  System.SysUtils;

{ TMyGame }
procedure TMyGame.OnLoad;
begin
  // open archive file
  Engine.OpenArchive(cArchiveFilename);
end;

procedure TMyGame.OnExit;
begin
  // close archive file
  Engine.CloseArchive(cArchiveFilename);
end;

procedure TMyGame.OnStartup;
begin
  // open display
  Display.Open(cDisplayWidth, cDisplayHeight,  cDisplayFullscreen, cDisplayTitle);

  // create font, use buildin
  FFont := TFont.Create;
end;

procedure TMyGame.OnShutdown;
begin
  // free font
  FreeAndNil(FFont);

  // close display
  Display.Close;
end;

procedure TMyGame.OnUpdate(aDeltaTime: Double);
begin
  // process input
  if Input.KeyboardPressed(KEY_ESCAPE) then
    Engine.SetTerminate(True);
end;

procedure TMyGame.OnClearDisplay;
begin
  // clear display
  Display.Clear(BLACK);
end;

procedure TMyGame.OnShowDisplay;
begin
  // show display
  Display.Show;
end;

procedure TMyGame.OnRender;
begin
  // render any graphics here
end;

procedure TMyGame.OnRenderHUD;
var
  Pos: TVector;
begin
  // assign hud start pos
  Pos.Assign(3, 3, 0);

  // display hud text
  FFont.Print(Pos.X, Pos.Y, Pos.Z, WHITE, alLeft, 'fps %d', [Engine.GetFrameRate]);
  FFont.Print(Pos.X, Pos.Y, 0, GREEN, alLeft, 'Esc - Quit', []);
end;

To run your game, call

Engine.Run(TMyGame);

NOTE: For GameVision to work properly, execution MUST start with Engine.Run(...). This call will property setup/shutdown the library and log and handle errors. Only one GameVision app instance is allowed to run and will safely terminate if more than one is detected.

See the examples for more information on usage.

Media

GameVision-Intro01-highlight.mp4
Script.HotReload.mp4

Support

Website https://tinybiggames.com
E-Mail [email protected]
Discord https://discord.gg/tPWjMwK
Twitter https://twitter.com/tinyBigGAMES
Facebook https://facebook.com/tinyBigGAMES

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.