Subscript Error

new topic     » topic index » view thread      » older message » newer message

Hi all,

I am having trouble with this for loop and subscript atom issue. attempt to subscript an atom in subscript of #1 of 'buildings'

Trying to make a euphoria version of this: https://github.com/raysan5/raylib/blob/master/examples/core/core_2d_camera.c

Note: A rectangle struct from Raylib is Rectangle(x,y,width,height) Using Greg's FFI library.

public constant Rectangle = define_c_struct({ 
	C_FLOAT, --x top-left corner pos x 
	C_FLOAT, --y top-left corner pos y 
	C_FLOAT, --width 
	C_FLOAT --height 
}) 
include raylib.e 
include std/ffi.e 
 
constant MAX_BUILDINGS = 100 
 
constant WIDTH = 800 
constant HEIGHT = 450 
 
InitWindow(WIDTH,HEIGHT,"2D Camera") 
 
enum player_x = 1, 
	 player_y, 
	 player_width, 
	 player_height 
	  
enum building_x = 1, 
	 building_y, 
	 building_width, 
	 building_height 
	  
enum colorb_r = 1, 
	 colorb_g, 
	 colorb_b, 
	 colorb_a 
 
sequence player = {400,280,40,40} --Rectangle 
sequence buildings = {0,0,0,0} --Rectangle 
sequence buildColors = {0,0,0,0} --Color 
 
integer spacing = 0 
 
for i = 1 to MAX_BUILDINGS do 
	buildings[i][building_width] = GetRandomValue(50,200) --error comes from this line 
end for 
new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu