November 25, 2020, 07:59:36 AM

Author Topic: [bb] Asteroids FPS by Andy [ 1+ years ago ]  (Read 674 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
[bb] Asteroids FPS by Andy [ 1+ years ago ]
« on: June 29, 2017, 12:28:38 AM »
Title : Asteroids FPS
Author : Andy
Posted : 1+ years ago

Description : Demonstrates how to make an asteroids game in 3D with a First Person View

Code :
Code: BlitzBasic
  1. Graphics3D 640,480
  2. SetBuffer BackBuffer()
  3.  
  4. camera=CreateCamera()
  5. light=CreateLight()
  6. tex=LoadTexture( "coolgrass2.bmp")
  7. ScaleTexture tex,1000.0,1000.0
  8.  
  9. brush=CreateBrush()
  10. BrushTexture brush,tex
  11.  
  12. plane=CreatePlane(8)
  13. PaintEntity plane,brush
  14. PositionEntity camera,0.0,50.0,0.0
  15. RotateEntity camera,90,0.0,0.0
  16.  
  17. dist#=0.1
  18. x#=0
  19. y#=0
  20. z#=0
  21.  
  22. While Not KeyDown( 1 )
  23. If KeyDown( 203 )=True Then angle#=angle#+1.0
  24. If KeyDown( 205 )=True Then angle#=angle#-1.0
  25.  
  26. If KeyDown( 200 )=True Then
  27. x#=x#+Cos(angle#+90.0)*dist#
  28. z#=z#+Sin(angle#+90.0)*dist#
  29. EndIf
  30.  
  31. RotateEntity camera,0.0,angle#,0.0
  32. TranslateEntity camera,x#,0.0,z#
  33.  
  34. RenderWorld
  35.  
  36. Text 0,20,"X Position: "+x#
  37. Text 0,40,"Y Position: "+y#
  38. Text 0,60,"Z Position: "+z#
  39.  
  40. Flip
  41. Wend
  42.  
  43. End


Comments :


Boiled Sweets(Posted 1+ years ago)

 What about the Y axis?What about momentum?What about inertia?This needs work...


Andy(Posted 1+ years ago)

 >What about the Y axis?>What about momentum?>What about inertia?>>This needs work...I didn't need any of those things in my project, but hey, that is why I placed it in the PUBLIC DOMAIN section, so that YOU can change it to YOUR liking.


 

SimplePortal 2.3.6 © 2008-2014, SimplePortal