TGC Codebase Backup



Self working rpg game by cheese pwner

3rd Jun 2011 18:56
Summary

Still working on, many problems



Description



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    rem Standard Setup Code
sync on : sync rate 30 : color backdrop rgb(0,0,128) : hide mouse
set text font "arial" : set text size 12 : set text transparent
Make matrix 1, 10000,10000,20,20
load object "..\..\..\AppData\Local\Temp\media\H-Knight-Move.X",1
rem Load image "C:\Users\Ryan\Pictures\....jpg",1
load image "..\..\..\AppData\Local\Temp\media\knight.bmp",2
texture object 1,2
rem Prepare matrix texture 1,1,1,1
rem Fill matrix 1,0,1
	scale object 1,3000,3000,3000
	loop object 1
	rotate object 1,0,180,0
	fix object pivot 1
remstart
rem make buildings and walls
	make object box 20, 80, 60, 10
position object 20, 100, 30, 100
rem done making buildings and walls
remend


rem make enemies
make object sphere 10,10
make object cube 11,10
position object 10, 200,10,200
position object 11, 300,10,200
`quest is 0 if
Do
	if quest1=.5
	X# = Object position x(1)
	Z# = Object position z(1)
	LKS#=Object position y(1)
		Y# = Get Ground Height(1,X#,Z#)
		AngleY# = object angle Y(1)
	If Leftkey()=1 then Yrotate object 1,Wrapvalue(AngleY#-2.5)
	If Rightkey()=1 then Yrotate object 1,Wrapvalue(AngleY#+2.5)
	If Upkey()=1
		XTest# = Newxvalue(X#,AngleY#,20)
		ZTest# = Newzvalue(Z#,AngleY#,20)
		Move object 1,5
		Endif
	CameraZ# = Newzvalue(Z#,AngleY#-180,100)	
	CameraX# = Newxvalue(X#,AngleY#-180,100)
	CameraY# = Get Ground Height(1,CameraX#,CameraZ#)
	Position camera CameraX#,CameraY#+100,CameraZ#
	Point camera X#,Y#+25,Z#+25
	sync
loop

function quest1begin()

endfunction 
remstart
Could be helpful:
Point Object id, xPos#, yPos#, zPos# 
It could point enemy at u.
 

download sparky's collision

remend