Cobra (programming language from Squeaky Duck)

Cobra (programming language from Squeaky Duck)
Cobra
Paradigm(s) Procedural
Typing discipline weak, static
Influenced by Pascal
Usual filename extensions .cps, .clm

Cobra is a programming language developed by Graham Kennedy from the Squeaky Duck Design Company (http://www.squeakyduck.co.uk). It is a rapid application development language, designed primarily for easy creation of computer game software but also includes tools that allow for application development. The syntax is based on the Pascal programming language and also allows the inclusion of Assembly Language routines.

Contents

Features

Both a 2D and 3D engine are implemented in the Cobra programming language. Each works independently of the other but both can be used simultaneously.

Cobra3D

Cobra3D is the current name for Cobra's 3D computer graphics engine component that uses an enhanced version of GLScene (a free 3D lib for Delphi). It utilizes OpenGL, and aims to take advantage of OpenGL's power and portability. In addition to basic 3D capabilities similar to other 3D engines, to simplify and speed up development of 3D games, Cobra's 3D Engine comes included with 3D special effects such as shadows, shaders, blurring, cel shading, and particles.

Pure2D

Cobra's "Pure2D" library works independently of the 3D engine and actually requires no 3D acceleration or runtime libraries whatsoever (DirectX or OpenGL are not required[1]). It supports effects that are usually only feasible by using 3D hardware. Among these are real-time rotations, scaling, and free-form transforming. In addition, Cobra supports real-time blend modes for sprites, and alpha blending for its drawing commands (which include basic shapes).

Cobra2D

Cobra2D is a 2D hardware-accelerated version of Pure2D.

Other

Other features include:

  • Support for several audio file formats, including mp3 and Ogg Vorbis
  • Ability to render AVI movies and save with virtually any available codec
  • Built in GUI commands
  • Networking support
  • Built in frame limiting
  • Multiple joystick support
  • 2D and 3D physics engines in beta

Code

The following is an example of Cobra source code. It loads a 3D object and rotates it with full planar dynamic shadows.

program 
uses cobra3d, keyset 
 
var 
   cam, light, light2 : element 
   buggy1 : element 
   ground : element 
 
begin 
 
   openscreen(800, 600) 
 
   cam = createcamera() 
   usecamera(cam) 
   positionentity(cam, 0, 15, 50) 
   EntitySetAttribute(cam, 'DepthOfView', 1100) 
   EntitySetAttribute(cam, 'FocalLength', 120) 
 
   light = createlight(cam) 
   light2 = createlight() 
   positionentity(light2, 40, 40, 0) 
 
   ground = createshadowplane() 
   rotateentity(ground, 90, 0, 0) 
 
   buggy1 = loadmesh('buggy3ds\buggy2.3ds') 
   scaleentity(buggy1, 0.1, 0.1, 0.1) 
 
   EntitySetAttribute(ground,'width',700) 
   EntitySetAttribute(ground,'height',700) 
   EntitySetAttribute(ground,'xtiles',50); 
   EntitySetAttribute(ground,'ytiles',50); 
 
   setshadowlight(ground, light2) 
 
   setshadowobject(ground, buggy1) 
   setcameratarget(cam, buggy1) 
 
   while not keydown(vk_escape) 
 
      turnentity(buggy1, 0, 0.05, 0) 
      flip 
 
   wend 
 
end

Cobra LE

At the end of August 2006, Idigicon and Graham Kennedy announced that Cobra would be re-targeted to the education market, complementing Idigicon's educational software and support for UK educational initiatives. Kennedy has revealed that this version, called Cobra Learning Environment will be the only version published by Idigicon.

The latest version is published by the Squeaky Duck Design Company (http://www.squeakyduck.co.uk) and builds upon the foundations of the education product.

See also

External links


References

  1. ^ Cobra 2D Engine Docs, "Pure2D requires no external DLLs like DirectX or special hardware to work, so it can be used on any computer running Windows 95 or above"

Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • Cobra (programming language from Cobra Language LLC) — Cobra Paradigm(s) Multi paradigm: object oriented Appeared in 2006 Designed by Chuck Esterbrook Developer Cobra Language LLC Stable release 2010 10 18 (O …   Wikipedia

  • Cobra (disambiguation) — A cobra is any of several species of snake. Cobra may also refer to: Contents 1 Fictional entities 2 Government and police 3 L …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”