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 / Gunscrolling

Author
Message
Lavitz
20
Years of Service
User Offline
Joined: 16th Jan 2005
Location: Raddix Studio
Posted: 29th Jan 2006 22:48
I noticed in games like timesplitters and other shoot-em-up games you are able to scroll through each weapon. How is this done in Darkbasic? I'm a novice, so don't flame me for no apparent reason. Like I want to use a pistol and then switch to a shotgun, how would I do this if the button I press for scrolling is the shift key?

Doom, Destruction, and Chaos! Mwahahahahahahahahaha!
Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 29th Jan 2006 23:38
You would need to lock a plain to the screen that has a hole in the middle, colour 0,0,0. Then just rotate a 2D plain of the guns behind the hole. You would need a border around the hole that is big enough on the right, to hide the guns as they rotate. The other side will go off the screen anyway.

Drew the G
User Banned
Posted: 30th Jan 2006 22:30
Do mean switch weapons with mouse scroller?

Lavitz
20
Years of Service
User Offline
Joined: 16th Jan 2005
Location: Raddix Studio
Posted: 31st Jan 2006 02:26
@ Pincho Paxton

What do you mean, hole? I have no idea what you are talking about, unless you or somebody else can explain it more clearly.

Doom, Destruction, and Chaos! Mwahahahahahahahahaha!
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 31st Jan 2006 04:22
Lavitz, do you mean an array that stores the gun information (the current gun selected, and the # of clips/bullets)? Or a how to show a scrolling gun on the screen?


Lavitz
20
Years of Service
User Offline
Joined: 16th Jan 2005
Location: Raddix Studio
Posted: 31st Jan 2006 04:59
Making an array that stores the guns so that when you press the shift key, it makes the gun you are currently using go down, and then show the next gun on the list pop up. I know the popping up and going down part is of the animation process, but I need to know how to do this sort of thing to be able to make my FPS successful.

Cheerio!

Doom, Destruction, and Chaos! Mwahahahahahahahahaha!
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 31st Jan 2006 06:07
Ok you just make an array and define it. It can hold as much information as you want for each gun (clips, bullets, amount of damage, weapon upgrades... whatever you want). The very basic is just clips and bullets. The current weapon thats being used can be put into a variable (in the code snip I use "CGun").

The shift key increases CGun until it sees the first gun in the array has more than zero clips or bullets. If it reaches the end it wraps around to the start of the array.

The enter key simulates picking up new guns (very basic... it can pick guns that you already have).




Lavitz
20
Years of Service
User Offline
Joined: 16th Jan 2005
Location: Raddix Studio
Posted: 31st Jan 2006 08:16
Looks good, but I'm looking towards a thing that also does damage and not be visible as text. Like I would be walking down a corridor with a pistol, and in real life you can't see how many bullets you have on a monitor. This is what I'm aiming for. I'll post the code I have so far so you can help me place in the data for the gunscrolling and the other things such as bullets, clips, and damage as soon as I'm finished doing the coding for the area I'm at.

Doom, Destruction, and Chaos! Mwahahahahahahahahaha!
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 31st Jan 2006 08:36
Uh that was an example of an array. I'm not going to do the whole game for you for an example.

Post when you have a problem with code or need somebody to point you in the right direction.


Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 31st Jan 2006 09:17
Quote: "@ Pincho Paxton

What do you mean, hole? I have no idea what you are talking about, unless you or somebody else can explain it more clearly.
"


Set Object OBJECTNUMBER,1,0,1

This will turn colour 0,0,0 into a hole. So you make a plain, and you texture it with a coloured square, and the square has a black hole in the middle. This will be your HUD. The HUD is locked to the screen. The guns are positioned behind the hole, and can be rotated.

Lavitz
20
Years of Service
User Offline
Joined: 16th Jan 2005
Location: Raddix Studio
Posted: 1st Feb 2006 02:16
Ahh, now I get it. Sorry for not understanding earlier.

Doom, Destruction, and Chaos! Mwahahahahahahahahaha!

Login to post a reply

Server time is: 2025-05-23 16:52:42
Your offset time is: 2025-05-23 16:52:42