What would be a nice feature is to be able to use Arrays in functions if cant do that already and expand a little on the draw commands. Like
Type _Points
x# as float
y# as float
endtype
Points as _points[3]
Points[0].x# = 10
Points[0].y# = 10
Points[1].x# = 30
Points[1].y# = 30
Points[2].x# = 70
Points[2].y# = 70
Points[3].x# = 90
Points[3].y# = 90
do
drawpolygons ( Points, makecolor (255,0,0) )
loop
function DrawPolygons ( Polygon as array , colour as integer)
for a=0 to Polyigon.length - 1
drawline ( Polygon [ a ] . x, polygon[ a ] . y, polygon[ a + 1] . x , polygon [ a + 1 ] . y, colour, colour)
next
drawline ( Polygon [ a +1 ] . x, polygon[ a +1 ] . y, polygon[ 0 ] . x , polygon [ 0 ] . y, colour, colour)
endfunction
and even better - to be able to FILL it out with a colour
or something along those lines
I think a FILL command can be achievable by working with memblocks - hmmmm something to think about in the future - notjust yet though
but been able to use Arrays diretly on functions would be nice so the code in the snippet would work quiet well
AGK now
// Project: Drawings
// Created: 2017-01-15
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "Drawings" )
SetWindowSize( 1024, 768, 0 )
// set display properties
SetVirtualResolution( 1024, 768 )
SetOrientationAllowed( 1, 1, 1, 1 )
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
Type _Points
x# as float
y# as float
endtype
global Polygons as _points[3]
Polygons[0].x# = 200
Polygons[0].y# = 200
Polygons[1].x# = 250
Polygons[1].y# = 150
Polygons[2].x# = 50
Polygons[2].y# = 50
Polygons[3].x# = 100
Polygons[3].y# = 200
do
drawpolygons ( makecolor (255,255,255) )
Print( ScreenFPS() )
Sync()
loop
function DrawPolygons ( colour as integer)
for a=0 to Polygons.length - 1
drawline ( Polygons [ a ] . x#, polygons[ a ] . y#, polygons[ a + 1] . x# , polygons[ a + 1 ] . y#, colour, colour)
next
drawline ( Polygons [ a ] . x#, polygons[ a ] . y#, polygons[ 0 ] . x# , polygons [ 0 ] . y#, colour, colour)
endfunction
Damo
Using Tier 1 AppGameKit V2
Started coding with AMOS
Works with a Lenovo IdeaPad 700, 1TB SSD (Data), 128GB HD (System), 12GB Ram, GeForce Nvdia 950M, Windows 10, 2.3Ghz (Turbo to 3.2ghz when required)