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 Professional Discussion / Sprites in darkPro

Author
Message
Brux
14
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 12th Oct 2011 18:43
Sorry for mistakes
I recently started programming in darkpro
I made ​​a simple program sprites that move in horizontal
but the sprites move jerkily, while DarkBasic
I worked with bobs were very smooth
my system, is 'windows 2000

Thank's
noobnerd
15
Years of Service
User Offline
Joined: 30th Nov 2010
Location:
Posted: 12th Oct 2011 19:04
we need to see some code... I cannot possibly tell you what the problem is until then
WLGfx
18
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 12th Oct 2011 19:34
The sprites are very much the same as BOB's (assuming you mean blitter objects). It could be that your sync rate needs setting up properly.



Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Brux
14
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 14th Oct 2011 17:57
This is my simple code

sync on : sync rate 40
Rem this is swarm image
load image "alien1.bmp",1
set sprite 100,1,1
set sprite 101,1,1
size sprite 100,100,80

do

shiftx#=shiftx#+5.0
if shiftx#>550.0 then shiftx#=shiftx#-550

sprite 100,shiftx#,200,1
sprite 101,shiftx#,300,1
sync

loop


Rem move two sprites horizontally continuously
Rem why 'move jerkily ?

Da_Rhyno
15
Years of Service
User Offline
Joined: 25th May 2011
Location:
Posted: 14th Oct 2011 19:13
Change this



to this



Your sprite moves five pixels at a time, of course it will look like it's moving jagged.
zenassem
23
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 14th Oct 2011 21:38 Edited at: 14th Oct 2011 21:43
Quote: "
Your sprite moves five pixels at a time, of course it will look like it's moving jagged."


I've never had a problem with this causing the movement to look jagged or jerky,, especially a such a low interval like 5 pixels.

- Though Why is "shiftx" a float "#"? It should be an integer

- Why is the sync rate 40? I generally set it ot 60 or 0.

- I would suggest adding a ,1 at the end of your load image line.

- Is the backsave going to be necessary? More often than not, I turn it off, and redraw the background every frame, placing a cls at the begining of the loop.

- Not sure that it matters in dbpro, but I tend to keep my sprites and the images of the sprites at sizes x & y based on the power of 2. for example 2,4,8,16,32,64,128,256... It's probably not as important thesed days, but it's something I am in the habit of.

Your signature has been erased by a mod please reduce it to 600 x 120.
Brux
14
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 18th Oct 2011 15:33
I made ​​the changes sync rate to 60 and cls at the Beginning of the loops.
now flows faster. thanks

Login to post a reply

Server time is: 2026-07-10 06:08:06
Your offset time is: 2026-07-10 06:08:06