TGC Codebase Backup



Rotating Earth Code by Ersh

8th Apr 2012 19:03
Summary

Update 09/04/12: Now able to move camera anywhere using all keys enabled, but soon will include more keys. Just of space and also of rotating Earth, but will require the User to ad



Description

Well its just a simple code for those who would want to make a realistic world, so all it is just a rotating earth but which the user will have to add his/her own tecture to it themselfs which would make it look very Good! and also this has included sun and moon



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    center text 400,40,"Press Any Key to Play"
center text 400,50,"Created By Ersh'"
  wait key
  
sync on
sync rate 0

color backdrop rgb (0,0,0)


make object sphere 1, 100, 40, 40
load image "v7gxtx.png" , 1
texture object 1, 1

make object sphere 2, 100, 40, 40
Position object 2, -250, 0, 0
color object 2, 222666
texture object 1, 1


  angle = 0

set camera range 1,2000

sync on

do

   if upkey()=1 then move camera 5

   if rightkey()=1 then angle=angle+1
   
   if downkey()=1 then move camera -5

   if leftkey()=1 then angle=angle-1

   yrotate camera angle

   sync

loop
      
set ambient light 100
color ambient light rgb(255,255,255)
position camera 0, 20, -140


do
  yrotate object 1, object angle y(1) + 0.001
  sync
  loop