No questions are daft if you're struggling to understand something! (Besides, I remeber what I was like when I was starting out
)
1) Yes, you're right. Try and avoid the use of the word "object", though, as that implies 3D commands in DBP - "entity" or "item" would be better for your variable names.
Quote: "WorldObjects[0].SpriteID = 2
WorldObjects[1].SpriteID = 2
WorldObjects[2].SpriteID = 6"
You probably know this already, but you only need one sprite for each item (table, chair), hide it, then call Paste Sprite in your main program loop to put several copies of it on screen.
2) Not quite. You can box it off like you've suggested, but that implies each region is a "mini-world" and you can't easily move from one region to another.
Carve your world up like a chessboard, the entire board is the "world" but each square is a "sector", if you like. Then you would need:
Dim WorldObjects(NumberOfSectors, Max_NumberOfObjectsInSector) as worldItem
Just fill the list of items on a sector by sector basis.
Consider a 3x2 grid (v is the sector you're currently in):
[1][2][3]
[4][5][6]
You can make each sector as large as you like - say 1000x1000 pixels. Let's say that (WorldX, WorldY) = (1200, 500), then you're in sector 2. So every item in sector 2 should be drawn. However, if you look at the attached picture you'll see that the current screen viewport (shown in red) overlaps on neighbouring sectors as well - in this case, 3, 5 and 6. So sectors 3,5,6 need checking as well to see if any objects within them are on screen at this time.
I'm not sure whether it would be faster to render everything by default, or check all four of these sectors for what is actually visible and then draw what you select - you'd have to experiment.
3) Put at the top of your code:
Then when your viewpoint shifts ("camera", but not the 3D type, slides to the right) you update the coordinates:
WorldX = WorldX + CameraMoveAmountX
WorldY = WorldY + CameraMoveAmountY
then just read off WorldXX and WorldY as you need them.
4) My mistake
, the command is called "Move Sprite". Try the help file example:
load image "manwalking.bmp",1
cls
sprite 1,100,100,1
for t=0 to 359
rotate sprite 1,t
move sprite 1,1
next t
do
loop
end
This will take the ManWalking.bmp (or any image) and move it in the a circle by rotating then shifting the image forward one pixel in the direction it is facing.
Hope this helps!
We spend our lives chasing dreams. Dark Basic lets us catch some of them.