Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Functions for beginners

Author
Message
Emperor Baal
20
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 21st Jan 2004 17:59
Ive made some functions for beginners to help them with their game. Ill explain them here, I will add more functions when I got time.


Figure(int x,int y,int sides,int size,int rotate)
Draws n-gons. Kinda slow with big figures, so its best
when used in 2D.

x and y are the screen coordinates.
sides = amount of lines your figure should have (triangle = 3)
size = size of each line
rotate = rotate the figure

Multi_figure(amount-of-points)
Draws lines between given coordinates. The coordinates should be
in an array ( MUFIG_POINTS(amount,1) )

You can manually input the coordinates, or use random, example:

for fill=0 to amount
MUFIG_POINTS(fill,0)= rnd(640)
MUFIG_POINTS(fill,1)= rnd(480)
next fill


Distance(object one, object two)
Calculates the distances and returnes it (real/float number)

Camera_set_follow(object,distance_to_object#,rotate_camera#,height#)
Puts the camera behind the object.
Distance_to_object#=How far should the camera stay behind the object?
rotate_camera#=Rotates the camera, example:



Thats it, just copy those functions to your program and they should work (dont forget the array for multi_figure)

If you want an example, then remove the REMSTART and REMEND for the 2D OR 3D loop. And remove the REM in the DO LOOP for a little demonstration of the function.





I'm busy making more functions, so hold on


Quote: "
Amd 2500+ | 1024mb pc2700 | A7N8X-X | Geforce4 ti 4200 128mb
"
kidsa
20
Years of Service
User Offline
Joined: 8th Dec 2003
Location: MA,usa
Posted: 7th Feb 2004 00:12
in stead of the word player do you put the name of what you are using

Login to post a reply

Server time is: 2024-04-28 14:23:01
Your offset time is: 2024-04-28 14:23:01