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 / 2D isometric game

Author
Message
20Glyphs
10
Years of Service
User Offline
Joined: 7th Mar 2015
Location:
Posted: 7th Mar 2015 21:16
Hello, i'm a noob. I'm currently attending a game design major in college. Our final project is making a game using darkbasic. I decided to create an isometric 2D tank game. I have all the art ready, enemy AI and I used the code snippet that a member here posted for isometric games (I give full credit).

My problem is with the isometric point of view. The code I used works, the tiles are there and everything is fine but I want to add my environment now, how do I do that?

Much appreciated.
Sph!nx
16
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 7th Mar 2015 23:01
How do you wish to set this up?

Easy
• Create a large image of your level.
• Create an image for your level collision
• Load both images, make the collision image invisible

Harder
Create a tile engine. Basically, the map exists of tiles. Those tiles also have data, indicating collision and other effects.

You load the tiles row by row, preferably from an external data file.

I know my explanation is a bit basic, but there are many many ways to do that. I suggest you do a search for "isometric" and "isometric tiles" on this board. There are many threads to be found.

Also note, that Darkbasic (pro) is more for 3D application, but 2D is doable, although I suggest AppGameKit for that.

Regards Sph!nx
20Glyphs
10
Years of Service
User Offline
Joined: 7th Mar 2015
Location:
Posted: 7th Mar 2015 23:29
Quote: "How do you wish to set this up?

Easy
• Create a large image of your level.
• Create an image for your level collision
• Load both images, make the collision image invisible

Harder
Create a tile engine. Basically, the map exists of tiles. Those tiles also have data, indicating collision and other effects.

You load the tiles row by row, preferably from an external data file.

I know my explanation is a bit basic, but there are many many ways to do that. I suggest you do a search for "isometric" and "isometric tiles" on this board. There are many threads to be found.

Also note, that Darkbasic (pro) is more for 3D application, but 2D is doable, although I suggest AppGameKit for that."


Thank you so much for the quick reply.

Currently, the set up is using the tile engine. From what I understood around here, it's simpler to use arrays to store the data of each tile. That was the impression I was under and I tried to make a workaround by implementing the tile engine AND working around it a large image for the map. It didn't work.

For the easy path, I was wondering how can I set up the view to be isometric? as you said, DB is strictly a 3D IDE, so there are no 2D cameras for easier functionality. I'd be willing to try all options.
Ortu
DBPro Master
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 8th Mar 2015 05:39 Edited at: 8th Mar 2015 05:43
2d never really has a 'camera' it only has screen space, dbp focuses just as fully on 2d as it does on 3d.

For true 2d games, the isometric view is handled entirely in the art assets, your images and sprites which get pasted to the screen.

If you want a camera to provide an isometric view, that is called 2.5d and basically renders a fully 3d environment from a relatively fixed '2d' perspective.

If you already have a tile engine working, your environment should really be made out of the tiles

Burning Feet Man
17
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 8th Mar 2015 10:02
I've dabbled with 3D isometric, simply by using orthographic values on the camera. The result is an isometric game, but using ordinary 3D coordinates, or, simply 2D coordinates if you stick to the XZ Plane.

Here's a (god awful) mash up I made a few years back. I should really re-visit ortho 3D again, as I love the look of it.

Tap O for Ortho, and P for Perspective. This effect is had without plugins or complex code. All that I did was tweak the native DBPro camera inputs with numbers.

Here's the values I used;



Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia

Attachments

Login to view attachments
Sph!nx
16
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 8th Mar 2015 14:40
Quote: "Currently, the set up is using the tile engine. From what I understood around here, it's simpler to use arrays to store the data of each tile."


Yup, an array is the way to go. I would use an external file with the map data, load it with DBP program and add it all to an Array. The array can have all additional data, like collision, for each tile.

Isometric is basically just a perspective of the media. You could use the 3D space and a camera (set to orthographic view) or use a static camera and move the world media.

Regards Sph!nx
20Glyphs
10
Years of Service
User Offline
Joined: 7th Mar 2015
Location:
Posted: 8th Mar 2015 23:19
Okay, guys. Thanks for all the help. I got the scrolling to work with the image. Now, one more thing. I use WASD to scroll the map. Does anyone know a way to have the scrolling controlled by a sprite?
Sasuke
19
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 9th Mar 2015 05:04
When you mean controlled by a sprite do you mean like the view follows a sprite? Like a player?

"Get in the Van!" - Van B
Sph!nx
16
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 9th Mar 2015 13:23
If you choose not to go for the 3D space, like I mentioned, you basically move the environment media and keep the player sprite somewhere in view.

This way you create the illusion that the player is moving in a static world where the camera is following the player, but in fact it is the world that is actually moving.

Regards Sph!nx
20Glyphs
10
Years of Service
User Offline
Joined: 7th Mar 2015
Location:
Posted: 9th Mar 2015 19:35
Quote: "When you mean controlled by a sprite do you mean like the view follows a sprite? Like a player?
"

YES!! that's exactly what I mean.
Sph!nx
16
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 9th Mar 2015 23:42
Well, read my above post for 2D approach and if you wish to use the 3D space approach you simply set the camera's position to the player sprite.

Regards Sph!nx
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 13th Mar 2015 18:09
Here's a place to start:

Quote: "http://forum.thegamecreators.com/?m=forum_view&t=199418&b=6"



"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

Login to post a reply

Server time is: 2025-05-12 02:57:15
Your offset time is: 2025-05-12 02:57:15