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 Discussion / Alright, More questions :--)

Author
Message
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 2nd Jul 2005 01:09
Please Have answers organized to question number
(for example : 1.How do I reply? 1.Click the post button.)

So...

1. Can you have split-screen, Two player mode in DarkBasic Classic? If so, how?

2.Where do I get Nuclear Glory, a free version? Because I want to Make it so my character has collision on with the ground, buildings, etc.

3.
A-I have an X file for making my character and enemies attack, and I have a gun cursor. How do I make My character actually attack the object and kill it, when you press space key?? Do I need seperate bullets?

B-I have an x file for making my character and enemies die...How do I make it so when my character or an enemy gets shot, that object actually dies, then dissapears?

4.How do I have text in a transparent text box, and after a while the text box and text dissapear. (By textbox I mean like in pokemon or something...NO I am not making a violent 3D Pokemon game)

That is all.

Enjoy Life while your still alive.
Enjoy a recees anytime!
Jake Blues
20
Years of Service
User Offline
Joined: 19th Jun 2004
Location: United States
Posted: 2nd Jul 2005 01:19
1. No, not unless you constantly switch the camera position\range all the time to simulate two cameras. It runs slow though.

3B. With variables and if statments

4. With sprites and loaded images.

NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 2nd Jul 2005 05:10
GreenFox,

2. You will not find Nuclear Glory for free.

3. A-I You do not necessarily need an object for your bullets, because in reality, they cannot be seen when shot. However, if your bullet is much larger, say a cannonball, and will be going much slower than the average bullet, then an object may be needed for added effect. If you don't need the object, don't use it. It will just create more calculations for the computer to handle each loop.

Think about what needs to be coded to fake a bullet coming from a gun. This is the point where raytracing is needed. Raytracing is the method of sending out a ray or line segment from the shooter to the farthest distance a specific bullet can travel. Each unit of the segment is checked for collision between that point and any other object(any objects that can be shot). As soon as there is collision, some action is taken by the program(some lines of code are ran, depending on the object collided with).

Think of a ray simply being a single bullet that moves one unit at a time, checking if it has hit something upon arriving at each new coordinate. Likewise, a ray is 2 to 3 values, which are coordinate values, x y z. The difference is that the bullet is not accually being placed on these coordinates each loop, but we are simply checking for collision between each point(a point is the position of an object on its x y and z coordinates) and each object.

Below is a code snippet of a 2D program, in top-down view, which allows the user to send out a laser beam, upon the press of a specific key. It also allows the user to move around. When the key is pressed, in each program loop that the key is pressed, the ray checks at every point on the laser beam for collision of either, the man walking or the box object. In more realistic games, like a 3D FPS, the raycasting will not need to check the whole line segment each loop. Instead, for reality sake, since a bullet can only travel so far each program loop, then the raycasting would only need to check within the distance of travel for that loop, each loop.

Raycasting:


Copy and paste this program into your DarkBasic editor and then run it. Study the multiple REM comments which are throughout the source code. Ask if you have any specific questions. Check the forums, using the word raycasting.


+NanoBrain+
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 2nd Jul 2005 09:09
@NanoBrain
Thanks! But...
How do I make the ray nearly tranpearent and thicker/wider(like a pole)?
Also, I really dont want a line coming out of the players gun.. So How do I make it as the nearly transpearent ray fades away after the shot and the ray spirals (Like as in the matrix, where there is a green spiraling line traveling behind the bullet in slow motion).

@NeoDragon
Thanks alot for the help, especially on number 4. I can't belive I didn't think of that! Lol

Enjoy Life while your still alive.
Enjoy a recees anytime!
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 2nd Jul 2005 10:16
GreenFox,

First, understand that the laser in the 2D program, is just a representation of the ray and its path, to show how it works, and is not to be visible in any real game. That is, unless the weapon being used is a laser shooter, and the laser should be completely visible.

To make the ray thicker, instead of just checking for collision at the ray's point, you can check if an object is within a specific radius of the point. Essentially, this will create an imaginable circle around each point of the array, checking if any object is within that circle.

About spiraling, I don't see a good reason, unless your bullet is going to be slow enough to be visible. A true speeding bullet is not visible by the naked eye. However, if you are shooting a slow bullet, or are slowing time down, for instance, then let's think about how to do this.

What two factors can we use to create a spiral movement? What two motions make an object to have a spiral effect? First, there is the direction the bullet is headed, which without factoring in gravity, is a straight path. Second, is a circular movement, which its axis is perpendicular(at a 90o angle) to the direction of the bullet. Placing these two factors together will create the motion of the shape of a spring.

Ask me if you need help in trying to program a bullet which moves in a spiral motion. But first, experiment with the concepts above.


+NanoBrain+
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 2nd Jul 2005 17:14
Or you could make a .x file of you spiral.
this way, the only thing you'll have to do is position the x after the ray and rotate it around it's z-axis.

Immunity and Annihalation makes Immunihalation...
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 2nd Jul 2005 17:42
Sven B,

Good input.


+NanoBrain+

Login to post a reply

Server time is: 2025-05-22 19:19:35
Your offset time is: 2025-05-22 19:19:35