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.

2D All the way! / Various 2D Questions

Author
Message
Vid
19
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: United States
Posted: 9th Mar 2003 01:36
ok I have several questions,

1.Extremely nooby question, how do i control the speed of the animation of my sprites... not FPS right?

2.Can i incorporate 3D particle effects to a two dimensional game with no glitches to images in the background?

3.With a 2D tile system, would i have to make a loop for the size of the map, then use a sprite for each tile?

4.I have more that will be posted on this thread shortly.

Thanks,
Vid
indi
20
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 9th Mar 2003 03:26
1.Extremely nooby question, how do i control the speed of the animation of my sprites... not FPS right?

u can base the timing of each cell via your own timer commands or via the sync command and rely on play sprite.




2.Can i incorporate 3D particle effects to a two dimensional game with no glitches to images in the background?

hmm id use 3d plains as srites then u could access ghosting of psuedo sprites and particles will be seen through them if u wanted.




3.With a 2D tile system, would i have to make a loop for the size of the map, then use a sprite for each tile?


ya its 3 dimensions

so bascially something to this effect will be the for loop for a 3d tileset

assuming 640 x 480 using 32 x 32 sized sprites.
and sprites have been declared

for x = 1 to 10
for y = 1 to 20

position sprite 1,x*10,y*10,1

rem additional code here of course

print x
print y

next x
next y

u should always reduce the amount of work for the processor.
If u can make parts of the screen non interactive when not used or if u can mimic areas with blocks of images instead of one per tile u will gain a speed advantage.

it should be ok for DBP tho to use a sprite per tile.




4.I have more that will be posted on this thread shortly.

k

CloseToPerfect
20
Years of Service
User Offline
Joined: 20th Dec 2002
Location: United States
Posted: 9th Mar 2003 06:30
you can't use the same sprite number for each tile.

for x = 1 to 10
for y = 1 to 20
inc s,1
position sprite s,x*10,y*10,1
next x
next y
s = 0

Vid
19
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: United States
Posted: 10th Mar 2003 00:52
Thanks guys, im a bit confused with using an external array of data for a tile based game, such as a file like:

111111111111111
111222222221111
111111122111111
111111122111111
111111122111111

where 1= grass sprite and 2= path or whatever. Whats the simplest way to explain to me how to get whatever number to become a certain tile srite.

I have been to www.underweardesign.com and have DLed the tuts on this but i just need in plain english what you have to do in order.

Thanks All

Vid
zenassem
19
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 11th Mar 2003 04:18
I hope this helps...



zenassem
19
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 11th Mar 2003 04:33
I took out some of the extra stuff such as the viewable grid values and the movement so that you could just see the tile blit sections and the data elements



Vid
19
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: United States
Posted: 12th Mar 2003 05:58
Zenassem,
Thanks it helps majorly. Your an extremely organized code writer i dont see that often. thanks for al your help with the tiling engine i'll try my best to use your source as a basis of my own.

Again thanks,
-ViD-
Vid
19
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: United States
Posted: 12th Mar 2003 06:20
Zenassem,
I get one error with the code when i tried running yours exactly, for the draw_tile function, when it compiles it says that draw_tile is an unknown command, but its supposed to act as a function. is this because i am presently using the evaluation version of DBPro because im very sure the code is correct. If it is my version, no worries, my full version should be here tomorrow

thanks,
-ViD-
zenassem
19
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 12th Mar 2003 21:20
I'm not sure about the trial version. You can either try removing the underscore from the function name or take out the function and the function call all together and paste the code that's inside the function into the loop where the call was located.

This code was written in DBV113. I'll test it in DBPRO as soon as it arrives.

zenassem
19
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 12th Mar 2003 21:25
If you want I'll post up code more dedicated to your request later today. I pulled the prior code snippet from an app that had more stuff going on. Also the new code has an additional dimension to the array that allows for 5 layers.

Since your version may not like functions I'll code it straigth into the loop.

Vid
19
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: United States
Posted: 13th Mar 2003 01:50
Zenassem,
Thanks for all the help, i'll ook forward to the future posts.

-ViD-
zenassem
19
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 13th Mar 2003 04:00
here's the modified 3 dimensional array for 5 layers. Layer 2 is even with the character. I am going to release the completed code for the tile engine, mapmaker, and sample rpg when it's complete.



zenassem
19
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 13th Mar 2003 04:04
note:
In the above, I don't draw the water tiles. 0's represent transparent tiles.

Magnum
19
Years of Service
User Offline
Joined: 3rd Apr 2003
Location:
Posted: 7th Apr 2003 00:20
zennassem,

I am new to DBpro and have been looking over the board for info on how to create a background for a 2D game. This code snippet you posted has helped me understand what needs to be done.

I figured that might be the hardest part for me to learn, but turns out it might be fairly easy...


One thing I did notice, I had to move your If Tilenum<>500 command outside the SELECT CASE command to get it to work for me..





Login to post a reply

Server time is: 2023-01-27 01:00:34
Your offset time is: 2023-01-27 01:00:34