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
stankarp
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location: Australia
Posted: 10th Oct 2003 18:15
Would appreciate a bit of help please. Mainly because the help manual for DBPro does not contain all the showcase and usage examples it claims to.

I have a 2 d screen and have created and moved 7 sprites around on it. I am trying to use Sprite X (as shown from the help manual below), sprite Y and sprite angle to fix the position of one of the sprites when the spacebar is pressed after it has moved around for a while.
#############################
SPRITE X
This command will return an integer value of the current X position of the
specified sprite. The parameter should be specified using an integer value.

SYNTAX
Return Integer=SPRITE X(Sprite Number)

RELATED INFO
SPRITE Commands Menu
Index

EXAMPLE
View Showcase Example
View Usage Example
#####################

The links to the showcase and usage examples do not show the use of the these commands and I have been unable to work out the exact syntax, specifically how to insert the variable. Tried about 50 different things without success.

The other problem is with trying to get the camera to move.

The backdrop is a sprite 2000 by 2000 on a display of 1024X768. As some of the sprites move off to the right, I would like the camera to follow them but have been unable to make it do so. Tried various commands but all the examples I have come across are for matrixes.

Help pretty please
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 11th Oct 2003 00:30
I am not sure I understand your problem.

You say you have managed to display and move 7 sprites on screen and you are trying to get one of them to stop moving when the spacebar is pressed.

The easy answer is stop moving it. A sprite wont move unless your code instructs it to do so. So don't.

If you post your code I might have a better explanation for you.
stankarp
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location: Australia
Posted: 11th Oct 2003 02:51
Hi Scraggle,

What I want to do is fix the position of one particular sprite when I press the spacebar . I was trying to use the return Integer+sprite x because I could not find any example of how to do it.

I am working on a turn based strategy game and this is the tactical display to resolve combat.

The Backdrop is the sea(setup the same as the asteroid field in the sprite showcase example in help/examples). The next layer is ships moving slowly across the basckdrop, then a flak field also borrowed from the above example and finally a flight of aircraft thatcan be controlled. I want to establish the x,y position and angle of one of the aircraft as preparation for dropping their bombs by pressing the space bar. The flight of aircraft can circle, speed up, slow down on command so I can aim them at the target. They are four individual sprites that respond to up/down/left/right key the same way.

The code is a bit long to post.

These are examples I have tried.The Help manual is not very clear on this one unfortunately, particularly as I am a newbie.

Return Integer =SPRITE X(100),spx$
Return Integer spy#=SPRITE 100
Return Float spa#=SPRITE ANGLE 100

100 is the number of the aircraft sprite.

Hope you can help.
stankarp
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location: Australia
Posted: 11th Oct 2003 03:32
Should have not been trying to work on my game late last night after a few sherries and watching the Wallabies crawl over Argentina in the World Cup Opener.

What threw me is that when I copied and pasted the "Return Integer =SPRITE X(100)" from the help manual, the "Return Integer" bit was blue as well as if it was part of the function. It is, of course, where you put the variable. sigh, back to kindergarden.

So I have got that part now, but would still like some help on moving the camera on a sprite field.

Login to post a reply

Server time is: 2024-11-25 13:27:02
Your offset time is: 2024-11-25 13:27:02