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 / what the heck is wrong with this code???????

Author
Message
DBasic Khan
20
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: Alpha Quadrent, Sector 1,1 SOL SYS
Posted: 30th Apr 2004 21:35
this is a code i wrote so a hover craft can float up and down. Its not working. any ideas?

`make the ship float up and down like a space ship
a=rnd(4)
if a=4
if ypp#=11 `if the y position of the player =11
nypp#=ypp#-1 `the new " " " " "= " " "-1
endif
if ypp#=10
nypp#=ypp#+1
endif
endif
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 30th Apr 2004 23:35
Well, lets manually run through your code. ypp#=11 lets say. Ok, so we subtract 1. It now equals 10. Next line of code says if ypp# = 10 then add 1. So now ypp# = 11 again. And it'll go on doing that forever. ypp# will always equal 11. What you need to do is throw in a few flags.



"eureka" - Archimedes
Drunken French Munk
20
Years of Service
User Offline
Joined: 4th May 2004
Location: 3rd planet, sol system, alpha quadrent..
Posted: 4th May 2004 08:44
thanks (this is the same person, diffrent account because i cant acces from my house)

This is my home Profile, im AKA DBasic Kahn

"Poor guys, they had US surrounded"- US 101st Paratrooper at the Battle of the Buldge"

Login to post a reply

Server time is: 2024-09-22 08:31:32
Your offset time is: 2024-09-22 08:31:32