DBP

Kohaku's picture

Simple scipting

5
Average: 5 (1 vote)
//standard setup code
sync on
sync rate 30
 
 
//prepare the code holding array
dim code$(10)
 
 
//stick our code in an array
code$(1) = "print"
code$(2) = "hello!"
 
code$(3) = "print"
Kohaku's picture

Textwrap

0
No votes yet
function wraptext(ttw as string, xs as integer)
	f_r as string
 
	for a = 1 to len(ttw)
		if mid$(ttw,a) = " "
			sep = a
		endif
		if text width(left$(ttw, a)) > xs
			if sep = 0
Kohaku's picture

Distance based hiding

0
No votes yet
sync on
sync rate 30
 
`Place somewhere at the start
Global DH# : DH# = 15
 
make object cube 1, 10
 
do
 
	if upkey()
		move camera 1
	endif
 
	if downkey()
		move camera -1
	endif
 
Kohaku's picture

2D collision detection

0
No votes yet
rem Standard Setup Code
sync on : sync rate 60
set text font "arial" : set text size 12 : set text transparent
 
box1width = 50
box1height = 50
 
box2x = 220
box2y = 220
box2width = 300
Kohaku's picture

3D distance

0
No votes yet
function Distance3D(x1,y1,z1,x2,y2,z2)
	result#=sqrt((x1-x2)^2+(y1-y2)^2+(z1-z2)^2)
endfunction result#

Syndicate content