CurvedSpace Forums: game code - CurvedSpace Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • {lang:pm_locked} This topic is locked

game code

#1 {lang:macro__useroffline}   SlainThrax- {lang:icon}

  • Pro is spelled Prou
  • Icon
  • Group: Moderator
  • Posts: 2,854
  • Joined: 04-December 02

Posted 14 December 2006 - 06:40 PM

CODE
; Jumping Cone
;_______________

camdistanc=10
Graphics3D 640,480
SetBuffer BackBuffer()

; Creating the types
type_player=1
type_ground=2

; Create camera
camera=CreateCamera()
RotateEntity camera, 45,0,0

; Create a light
light=CreateLight()

; Creating a plane and texture
grid_tex=CreateTexture( 32,32,8 )
ScaleTexture grid_tex,10,10
SetBuffer TextureBuffer( grid_tex )
Color 0,064:Rect 0,0,32,32
Color 0,0,255:Rect 0,0,32,32, False
SetBuffer BackBuffer()
grid_plane= CreatePlane()
EntityTexture grid_plane,grid_tex
EntityBlend grid_plane,1
EntityAlpha grid_plane,.6
EntityFX grid_plane,1
EntityType grid_plane, type_ground

; Creating a mirror
CreateMirror()

; Creating a cone
cone=CreateCone(64)
EntityType cpme,type_player
PositionEntity cone, 0.1.5
ScaleEntity cone,0.4,0.4,0.4
EntityRadius cone, 0.5
Texture=CreateTexture(16,16): SetBuffer TextureBuffer(texture)
ClsColor 256,6,56
Cls
Color 12,126,256
Rect 0,0,8,8,1
Rect 8,8,8,8,1
ScaleTexture Texture,.2,.2
EntityTexture cone,texture

; The following code make the program run

While Not KeyDown( 1 )
y#=0

If KeyDown( 208 )=True Then velocity#=velocity#-0.001
If KeyDown( 200 )=True Then velocity#=velocity#+0.001
If KeyDown ( 31 ) Then velocity#=0
If KeyDown ( 31 ) Then xvelocity#=0
If KeyDown( 203 )=True Then xvelocity#=xvelocity#-0.001
If KeyDown( 205 )=True Then xvelocity#=xvelocity#+0.001
If KeyDown( 57 )=True Then y#=y#+0.5

MoveEntity cone,xvelocity#,y#,velocity#
TranslateEntity cone, 0,-0.1,0
PositionEntity camera, entittyx(cone),0,EntityZ(cone)
MoveEntity camera,0,0,-5
Collisions type_player,type_ground,2,2
Collisions type_ground,type_player,2,2

UpdateWorld

RenderWorld
Flip

Wend

End

"See, I think drugs have done some *good* things for us, I really do. And if you don’t believe drugs have done good things for us, do me a Favor: go home tonight and take all your albums, all your tapes, and all your cd’s and burn em’. 'Cause you know what? The musicians who’ve made all that great music that’s enhanced your lives throughout the years...
Rrrrrrrrrrrrreal {expletive ninja'd by Cspace} high on drugs."
-- Bill Hicks

"Today a young man on acid realized that all matter is merely energy condensed to a slow vibration. That we are all one consciousness experiencing itself subjectively. There is no such thing as death, life is only a dream, and we are the imagination of ourselves. Here's Tom with the weather."
-- Bill Hicks

"It's not a war on drugs, it's a war on personal freedom. Keep that in mind at all times."
-- Bill Hicks


http://ctprofiles.net/2122894
0

Page 1 of 1
  • You cannot start a new topic
  • {lang:pm_locked} This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users