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.

Newcomers DBPro Corner / Real newbie question (im embarresed)

Author
Message
zencreator03
21
Years of Service
User Offline
Joined: 11th Jul 2003
Location:
Posted: 11th Jul 2003 19:51
OK i got Dark Basic Pro today, i have almost no program experience except some VERY basics i learnt earlier today, when i try to make an object move ( check source code ), it appears to be a blank screen, i am probably missin somit really simple but i have no idea wot it is. Cud someone show how to do some basic movement.
adr
21
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 11th Jul 2003 20:12
you need to loop the program to give the illusion of movement...

At work so I can't test the code - hopefully should point you in the right direction.



Bender:Blackmail’s such an ugly word. I prefer extortion. The x makes it sound cool.
JamesBlond
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Germany
Posted: 11th Jul 2003 20:14
sync on
for t = 1 to 100
cls :`This clears the old screen
circle t,90,30
sync :`This updates the screen each time the circle was moved
next t
suspend for key

Smile and be happy, things could be worse!
So I smiled and was happy, and things got worse...
zencreator03
21
Years of Service
User Offline
Joined: 11th Jul 2003
Location:
Posted: 11th Jul 2003 20:25
Thankyou very much for your help. OK is there any way i can get another object to appear to be following my object around the screen but instead of just setting the other objects x,y coords the same as mine is there a way in which there could be a delay in the other objects movement as if to give the appearence that, i move, then IT thinks and then follows to a point close to my original object. Thanks again.

Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 12th Jul 2003 00:11
sync on:sync rate 100:hide mouse
playerx=300
playery=150
monsterx=0
monstery=0
tic=0:sc=0
score=0
a$="GAME OVER! you died"
do
circle playerx,playery,5
box monsterx,monstery,monsterx+10,monstery+10
if leftkey() then dec playerx
if rightkey() then inc playerx
if upkey() then dec playery
if downkey() then inc playery
if playerx<5 then playerx=5
if playerx>600 then playerx=600
if playery<5 then playery=5
if playery>450 then playery=450
if tic=0
if monsterx<playerx-5 then inc monsterx
if monsterx>playerx-5 then dec monsterx
if monstery<playery-5 then inc monstery
if monstery>playery-5 then dec monstery
tic=2
endif
b$="You have stayed alive for:"+str$(score)+" Seconds"
text 0,0,b$
if (monsterx=playerx-5) and (monstery=playery-5)
center text playerx,playery,a$
sync
wait 2000
end
endif
dec tic:inc sc:score=int(sc/100)
sync
cls
loop

this gets an object to chase you and you get a score based on how many seconds you stay alive, plus you get a message when you die, that any help?, cheers.

Mentor.

zencreator03
21
Years of Service
User Offline
Joined: 11th Jul 2003
Location:
Posted: 12th Jul 2003 02:20
Thanx that really was a great help, thanx again.

Login to post a reply

Server time is: 2024-09-20 15:31:46
Your offset time is: 2024-09-20 15:31:46