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.

Author
Message
Jon wu
11
Years of Service
User Offline
Joined: 4th Nov 2013
Location:
Posted: 10th Dec 2013 17:18
i need help with my code. i am trying to get the camera to follow the object heres the code:
REM *****************************************
RemStart
*** TITLE - Galactic Math
*** VERSION - 1.0.0 LAST UPDATED - 11.21.2013
*** DEVELOPER - Tristan Green, John Wu
*** COPYRIGHT - Nothing Yet
*** DATE CREATED - 11.22.2013
***
RemEnd
REM *** START SYSTEM SETUP SECTION

hide mouse
autocam off

REM *** STOP SYSTEM SETUP SECTION
REM *****************************************

REM *****************************************
REM *** START INTRO SECTION
REM *** INTRO SECTION HEADER

REM DECLARE VARIABLES
REM SCREEN DISPLAY

cls 0
load bitmap "E:\Edutainment Game\images\Gala-Math.bmp"
ink rgb(0,0,0),0 : set text font "arial" : set text size 14 : set text to bold : set text transparent
center text 320,420,"Developed by Tristan Green and John Wu"
center text 320,434,"Copyright © Nothing 2013"

REM LOAD SOUNDS
REM SOUND EFFECTS
REM SPECIAL EFFECTS
REM REFRESH SCREEN
sync

REM *** INTRO SECTION LOOP

do
REM SCREEN DISPLAY
REM CONTROL INPUT
if Keystate(scancode())=1 then gosub OptionsSection
REM REFRESH SCREEN
sync
loop

REM *** END INTRO SECTION
REM *****************************************

REM *****************************************
REM *** START OPTIONS SECTION
REM *** OPTIONS SECTION HEADER

OptionsSection:
REM DECLARE VARIABLES
REM SCREEN DISPLAY
REM SOUND EFFECTS
REM SPECIAL EFFECTS
REM REFRESH SCREEN

REM *** OPTIONS SECTION LOOP

REM CONTROL INPUT
REM REFRESH SCREEN

REM *** END OPTIONS SECTION
REM *****************************************

REM *****************************************
REM *** START MAIN SECTION
REM *** MAIN SECTION HEADER
REM OBJECT CREATION

rem North Wall
make object box 6,2000,1000,10
rotate object 6,0,0,0
position object 6,120,5,120
texture object 6,2

rem East Wall
make object box 3,2000,1000,10
rotate object 3,0,90,0
position object 3, 1005,500,0
texture object 3,3

rem North Wall
make object box 4,2000,1000,10
rotate object 4,0,180,0
position object 4, 0,500,-1005
texture object 4,4

rem West Wall
make object box 5,2000,1000,10
rotate object 5,0,270,0
position object 5, -1005,500,0
texture object 5,5

REM FLOOR
Make object box 2, 200,1,200
position object 2, -1,-5,-1
color object 2,rgb(0,255,0)
REM PLAYER
make object sphere 1,50,5,50
color object 1,rgb(255,0,0)
position object 1,15,1,15

position camera 60,200,1
point camera 1,1,1

do
if rightkey() then move object 1,2
if leftkey() then move object 1,-2
sync
loop

Rem Arena Collision
If Object collision(1,6)>1 : rem make sure there is a solid collision
endif

Hasty
Derek Darkly
13
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 10th Dec 2013 17:26 Edited at: 10th Dec 2013 21:50
Have you tried SET CAMERA TO FOLLOW?

If that doesn't suit your needs, there's a decent example on this page:
A zelda-style camera control system?

(Keep in mind this is one of many ways to follow an object.)

D.D.
pcRaider
17
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 11th Dec 2013 03:30
You can learn it with a tutorial.

Monster Hunt 3D Tutorials
http://www.thegamecreators.com/?m=view_product&id=2030&page=3d_tutorial_index

windowsXp
Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 11th Dec 2013 18:28
And use the code button...

Jon wu
11
Years of Service
User Offline
Joined: 4th Nov 2013
Location:
Posted: 13th Dec 2013 17:03
srry im kinda a beginner to this progam so can u give me an example of the set camera to follow because i just want to see the numbers for the angle smooth and height

Hasty
wattywatts
15
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 13th Dec 2013 17:12
Either leave your current camera code as is and put this in your loop:


OR

Put this in your loop:


New sig coming soon..
Jon wu
11
Years of Service
User Offline
Joined: 4th Nov 2013
Location:
Posted: 13th Dec 2013 17:20
so heres what i put

REM *****************************************
RemStart
*** TITLE - Galactic Math
*** VERSION - 1.0.0 LAST UPDATED - 11.21.2013
*** DEVELOPER - Tristan Green, John Wu
*** COPYRIGHT - Nothing Yet
*** DATE CREATED - 11.22.2013
***
RemEnd
REM *** START SYSTEM SETUP SECTION

hide mouse
autocam off

REM *** STOP SYSTEM SETUP SECTION
REM *****************************************

REM *****************************************
REM *** START INTRO SECTION
REM *** INTRO SECTION HEADER

REM DECLARE VARIABLES
REM SCREEN DISPLAY

cls 0
load bitmap "E:\Edutainment Game\images\Gala-Math.bmp"
ink rgb(0,0,0),0 : set text font "arial" : set text size 14 : set text to bold : set text transparent
center text 320,420,"Developed by Tristan Green and John Wu"
center text 320,434,"Copyright © Nothing 2013"

REM LOAD SOUNDS
REM SOUND EFFECTS
REM SPECIAL EFFECTS
REM REFRESH SCREEN
sync

REM *** INTRO SECTION LOOP

do
REM SCREEN DISPLAY
REM CONTROL INPUT
if Keystate(scancode())=1 then gosub OptionsSection
REM REFRESH SCREEN
sync
loop

REM *** END INTRO SECTION
REM *****************************************

REM *****************************************
REM *** START OPTIONS SECTION
REM *** OPTIONS SECTION HEADER

OptionsSection:
REM DECLARE VARIABLES
REM SCREEN DISPLAY
REM SOUND EFFECTS
REM SPECIAL EFFECTS
REM REFRESH SCREEN

REM *** OPTIONS SECTION LOOP

REM CONTROL INPUT
REM REFRESH SCREEN

REM *** END OPTIONS SECTION
REM *****************************************


REM *****************************************
REM *** START MAIN SECTION
REM *** MAIN SECTION HEADER
REM OBJECT CREATION

REM FLOOR
Make object box 2, 200,50,200
position object 2, -1,-5,-1
color object 2,rgb(0,255,0)
REM PLAYER
make object sphere 1,50,20,50
color object 1,rgb(255,0,0)
position object 1,15,1,15

position camera -200,350,-200
point camera 15,5,15

rem North Wall
make object box 3,500,300,10
rotate object 3,0,0,0
position object 3, 15,20,15
texture object 3,2

rem East Wall
make object box 4,2000,1000,10
rotate object 4,0,90,0
position object 4, 1005,500,0
texture object 4,3

rem North Wall
make object box 5,2000,1000,10
rotate object 5,0,180,0
position object 5, 0,500,-1005
texture object 5,4

rem West Wall
make object box 6,2000,1000,10
rotate object 6,0,270,0
position object 6, -1005,500,0
texture object 6,5

do
if upkey() then move object 1,2
if downkey() then move object 1,-2
if rightkey() then turn object right 1,0.5
if leftkey() then turn object left 1,0.5
sync
loop

Hasty
Jon wu
11
Years of Service
User Offline
Joined: 4th Nov 2013
Location:
Posted: 13th Dec 2013 17:21
srryy instead of the point camera i put the code you gave me @wattywats

Hasty
pcRaider
17
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 13th Dec 2013 17:57 Edited at: 14th Dec 2013 04:56
example : SET CAMERA TO FOLLOW



windowsXp
wattywatts
15
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 13th Dec 2013 19:25
Try this.



New sig coming soon..
Jon wu
11
Years of Service
User Offline
Joined: 4th Nov 2013
Location:
Posted: 7th Jan 2014 16:59
thx it worked @wattywats

Hasty

Login to post a reply

Server time is: 2025-05-16 02:05:37
Your offset time is: 2025-05-16 02:05:37