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.

Newcomers DBPro Corner / Where to next, 2d gaming

Author
Message
Romedi
19
Years of Service
User Offline
Joined: 14th Jun 2005
Location: East Alabama
Posted: 15th Jun 2005 04:44
Hello everyone. I have had DarkBASIC Classic for four days now. So far I have used the Print and Input commands, Drawn shapes, Drawn circles, dots, and ellipses and moved them with my arrow keys. I have looked over the forum but there are aa couple of things I have not been able to find or figure out.

1. I went through Binary Moon's tutorial until the end of the 2D section. In that tutorial he has a bit of code that will make a star field. I managed to make a green box that would cover the bottom half of a 640*480 screen and place stars on the top half. However, using the code he provided I was unable to place red dots on the bottom half of the screen to simulate rocks.

2. When making the box on the bottom half of the screen why does the box formula have to be:

box 1,240,639,479 to cover as much as possible?

If I use box 1,240,640,480 nothing appears.

3. This is a little bit more advanced than the above, but I am curious how i would change from moving a circle with the arrow keys, to moving what I am thinking would be a sprite.

My goal is to eventually make a rpg game kind of like the first Zelda. Don't get me wrong, I'm not trying to ask someone to do it for me I just don't fully understand the tutorials (or atleast how to link them to my purpose).

4. Last, I have no clue how to make the screen for the game (the ground link walks on, and mountains/bushes he cannot pass through. Then change from area to area. At first I thought they would be bitmap images, however, I can only have 32 of them and Zelda had way more than 32 screens.

Thanks everyone.
NanoBrain
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 15th Jun 2005 07:14
Romedi,

1.What specific problem occured when trying to draw dots(rocks) at the lower section of the screen?

2.This is something that hasn't been brought up before, since I have been involved in the forums. I have noticed this same detail before, but without an answer to as why.

3.A sprite uses the same type coordinates as a circle, x and y. However, these coordinates are not initially at the center of the sprite, as is the coordinates for the circle. Therefore, you need to create an offset of the coordinates for the sprite. This can simply be done in the sprite sprnum,x,y,imgnum command itself. For the x coordinate, you would subtract half of the width of the sprite image from the x value. For the y cooridnate, subtract half the height of the sprite image from the y value.

So, you will manipulate the x and y coordinates just as if they were already at the center of the sprite, or just as if you were manipulating the coordinates of the circle command. Then, do the subtraction, like this.



4.For 2D top-down view games like Zelda, there is a specific method using image pallettes, or image maps. An image map is a single image which has proportinate blocks of images within it, where each block can be cut out into its own image number, and used as a block of land. I have never experimented with this method, so maybe someone else will come along to help ou here. Elsewise, search the forums.


+NanoBrain+
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 17th Jun 2005 09:46
Finally, a decent post from a newcomer!

Romedi, I'm not trying to discourage you from using DarkBASIC Pro and this will most likely not be the route you want to take but if you're in the begining of programming and are interested in making fantastic online 2D RPGSs, I'd suggest using BYOND.

BYOND is a free gaming engine for 2D programming. It comes with very simple to learn code, an image creator/loader (So basically if you wanted to have a Link sprite, you'd just create a new image in the program, draw him up in 32x32 pixels, and load him into the game with a few lines of code), an icon ANIMATOR to animate your icons very very easily, free online multiplayer support that's as easy as running your game and clicking "Host", free server support when you submit your game to the byond hub and its accepted, a client command window for things like chatting, text display, links, websites etc (So you could make a browser or display your game site to the right of your game), HTML support, and damn the list goes on. I used it for 5 years when I began programming, it's excellent and the fact that it's free just adds to it. After about a month of getting the basics down, you could quite literally program an online rpg with quests, weapons, ai, a huge world - OH, that reminds me! It comes with a map maker as well, so basically you enter the map maker and just click and drop each icon you want - and much more.

The downside? Well, the only possible ones I can think of is:
- Its mainly 2D games (3D takes a lot of knowledge of trig and a lot of time)
- It doesn't create .exe files, instead it creates .dmi files. That means in order for people to play your games they must download byond. But with some work on creating a downloading routine (maybe using dark basic for that? ), you could download byond without them knowing removing any chance of it looking "unprofessional".

Like I said, if you want to stick with DarkBASIC then I completely understand, but when it comes to fast and easy 2D games byond is the way to go.

Oh, some other features:
When your game is published on the byond hub you get:
- Free Game Forums
- A Subscription Service (meaning players of your game can pay YOU money for extras like secret armour... player owned houses, whatever you could think of, and byond will automatically figure out weather they are subcribers or not.
- Free advertising on their main site page
- The ability to add banners for your game (which will also be displayed on the site and in other peoples games (but not as annoying pop ups just in the top left in a small little box).
- More that Ive forgotten for sure.

The link is: http://www.byond.com - Goodluck with programming!


Current Projects: SHADE - Game Maker | Mecho - TGC Puzzle Entry | Halo Physics Engine | RovaR - Polygonal Collision Detection
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 17th Jun 2005 09:52
Might aswell add some more features I forgot:

- Autmatic Object Collision that is as simple as typing "density = 1" for each object you want collision for.
- Lighting effects and opacity effects to limit the user's view, so if you had a wall and wanted the user not able to see past the wall even know the camera is above them, set the walls opacity to 1 and presto its done. If you want torches to give off light just set the object's luminosity to 1, and give it a range for its luminosity.
- So much more.


Current Projects: SHADE - Game Maker | Mecho - TGC Puzzle Entry | Halo Physics Engine | RovaR - Polygonal Collision Detection
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 19th Jun 2005 01:21
I have an answer on you box-problem:

you screen is by default:
x: 640 pixels
y: 480 pixels

this means:
x: 0, 1, 2, 3, ... 638 and 639 (you have to start counting from 0)
y: 0, 1, 2, 3, ... 478 and 479 (same here)

if 1 coordinate of your box is out of the screen, the box will not be drawn.

Immunity and Annihalation makes Immunihalation...
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 19th Jun 2005 01:39
Quote: "2. When making the box on the bottom half of the screen why does the box formula have to be:

box 1,240,639,479 to cover as much as possible?
If I use box 1,240,640,480 nothing appears.
"


It occurs because DB classic does not provide clipping on all vector gfx operations. Some do (sprites/images), some don't. From memory it affects the LINE(partly), CIRCLE, BOX mainly commands as well as the Get Image + Copy Bitmap commands.

What's meant to occur, is that the language should clip the graphics element to the screen dimensions regardless of what coordinates you give it. In DB's case though, the moment a coord is outside the view port (the screen) then operation is rejected. DB classic is only basic i've seen that does this.

Kevin Picone
[url]www.underwaredesign.com[/url]
Play Nice! Play Basic (Release V1.073 Out Now)

Login to post a reply

Server time is: 2024-09-23 21:27:52
Your offset time is: 2024-09-23 21:27:52