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.

DarkBASIC Discussion / sprite wont move

Author
Message
The Nerd
22
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 26th Sep 2004 04:47 Edited at: 26th Sep 2004 04:48
Hi (made in db classic)

im working on a little program were you can control a sprite..... BUT
when i run the program it work but up in the left corner there blinking "Y POS : "
and thats irratating me
and if i delete the CLS it just fillin the hole side whit "Y POS : "
and if i just delete
the print and cls command from the loop the sprite disapear when i hit "d"
How can i hide the "Y POS : " so it dont show on the screen?!!???

here is the code



The Nerd

i make games, i play games... But the fun thing is that i like to make them more than play them....
Mentor
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 26th Sep 2004 05:48 Edited at: 26th Sep 2004 05:50
LOL what is happening is that without the print and the cls the sprite moves so fast it`s offscreen in an instant, if you change the line to

if inkey$()= "d" then sprite 1,sprite x(1) + 1,sprite y(1),1:WAIT 50

then the sprite can only move 20 pixels per second, before that it was probably off the screen in under 1/100th of a second, thats why it seemed to disapear, NOW you can remove the lines

print "V POS : ";sprite y(1)
cls

and you will see the sprite move, make the 50 in the wait statement lower to speed it up, and higher to slow it down, remember that this will alter the speed of the whole program loop while the key is pressed, also you can replace the goto label with the word DO and replace the goto <label> with LOOP, that will make the code neater, hope that helps, cheers.

Mentor.

PC1: P4 3ghz, 1gig mem, 3x160gig hd`s, Radeon 9800pro w cooler (3rd gfx card), 6 way speakers.
PC2: AMD 2ghz, 512mb ram, FX5200 ultra, 16 bit SB.
Mini ATX cases suck.
The Nerd
22
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 26th Sep 2004 08:37
Thanks

cheers!

The Nerd

i make games, i play games... But the fun thing is that i like to make them more than play them....

Login to post a reply

Server time is: 2026-07-17 14:25:18
Your offset time is: 2026-07-17 14:25:18