News:

Building a 3D Ray Tracer  By stevmjon

Main Menu

isometric

Started by stef, August 27, 2006, 11:31:47 AM

Previous topic - Next topic

stef

Hi!

A small demo of a isometric look

This is only the begin  ;), but one day maybe it will be a combination of Rockrush/Boulder dash - Sokoban - Pacman - Tetris and  a splash of QBert.

Greetings
stef

PlayBASIC Code: [Select]
; PROJECT : isometric
; AUTHOR : stef
; CREATED : 27.08.2006
; EDITED : 27.08.2006
; ---------------------------------------------------------------------


global tw=36
global th=18

global backim

type tfields
exist
x#,y#
starty#
endtype

dim field(20,20)as tfields

for y=0 to 19
for x=0 to 19
field(x,y).x#=400+(x*tw/2)-(y*tw/2)
field(x,y).y#=200+(x*th/2)+(y*th/2)
field(x,y).starty#=-50
next
next

gosub imagedraw

do
rendertoscreen

cls 0
drawimage backim,0,0,1

for y=0 to 19
for x=0 to 19
if field(x,y).exist=1
drawimage cubeim ,field(x,y).x#,field(x,y).y#-th,1
endif
next
next

if newcube=0
xpos=rnd(19)
ypos=rnd(19)
if field(xpos,ypos).exist=0 then newcube=1
endif

if field(xpos,ypos).exist=0
drawimage cubeim ,field(xpos,ypos).x#,field(xpos,ypos).starty#,1
if field(xpos,ypos).starty#<field(xpos,ypos).y#-th
field(xpos,ypos).starty#=field(xpos,ypos).starty#+4
endif
endif

if field(xpos,ypos).starty#>=field(xpos,ypos).y#-th
newcube=0
field(xpos,ypos).exist=1
endif

sync
loop

imagedraw:

tileim=newimage(tw,th)
rendertoimage tileim

quadc 0,th/2,tw/2,0,tw,th/2,tw/2,th,rgb(155,155,155)

tileim2=newimage(tw,th)
rendertoimage tileim2

quadc 0,th/2,tw/2,0,tw,th/2,tw/2,th,rgb(100,100,100)

backim=newimage(800,600)
rendertoimage backim
for y=0 to 19
for x=0 to 19

if even(x+y)
drawimage tileim,field(x,y).x#,field(x,y).y#,1
else
drawimage tileim2,field(x,y).x#,field(x,y).y#,1
endif
next
next

cubeim=newimage(tw,th*2)
rendertoimage cubeim
quadc 0,th/2,tw/2,0,tw,th/2,tw/2,th,rgb(200,200,0)

quadc 0,th/2,tw/2,th,tw/2,th*2,0,th*2-th/2,rgb(0,0,200)
quadc tw/2,th,tw,th/2,tw,th*2-th/2,tw/2,th*2,rgb(200,0,0)

return










Ian Price

Cool. Look forwards to seeing a playable game that combines all of the above elements. Good luck :)
I came. I saw. I played some Nintendo.

stef

Hi!

Will need a little time! A week or so. 8)

Hm?! Said already that gamemaking is a serious business. ::)

But as you know it is sometimes good to "think outside of the box".

Greetings
stef



Ian Price

Indeed it is. Nowadays the box always seems to be a lot smaller than when I first started playing games (back then, there was no box!).
I came. I saw. I played some Nintendo.