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 / shooting code

Author
Message
steve c
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: united kingdom
Posted: 30th Aug 2004 05:46
can somone tell me why my code aint working ime trying to make muti bullet shooting code but it keeps going wrong pls help



current projects
codename : tasgarad and discworld mysteries
life in the city watch
Kohaku
21
Years of Service
User Offline
Joined: 3rd May 2004
Location: The not very United Kingdom
Posted: 30th Aug 2004 06:37
Try a quick search of the Code Snippets forum, or even a gander in the Code Base itself. Thats what they're there for after all.

Infra-Dark
Bring the 20 liners back!
#coding, like coding, but with a #
steve c
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: united kingdom
Posted: 1st Sep 2004 03:57
ive searched loads of times but i cant find anything thats why ime asking here so anyone know pls

current projects
codename : tasgarad and discworld mysteries
life in the city watch
Kohaku
21
Years of Service
User Offline
Joined: 3rd May 2004
Location: The not very United Kingdom
Posted: 1st Sep 2004 08:44
Well my non-context sensitive twin, I found a few examples for multiple bullet shooting code. Here is one.
http://forum.thegamecreators.com/?m=forum_view&t=37235&b=7

Infra-Dark
Bring the 20 liners back!
#coding, like coding, but with a #
steve c
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: united kingdom
Posted: 2nd Sep 2004 05:47
sorry i dident mean to sound annoyed or whatever
but anyway can u just explain it to me or somthing because ive been trying to work out this code for ages and ive asked loads of time and its really annoying me

current projects
codename : tasgarad and discworld mysteries
life in the city watch
hyrichter
21
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 2nd Sep 2004 23:44
Here's some simple multi-bullet shooting code I'm using for my FPS. You're welcome to use it. I don't have time to really explain how it works, so hopefully you can figure it out from the code.



I normally don't like to just hand out code like this because it doesn't get you the experience you need. It took me a lot of thinking to come up with this code and get it to work right. Hopefully you can work it to work right with your game.

BTW, it's kinda interesting seeing two people with the same avatar throughout an entire thread. At first I thought you were quintiple posting.

steve c
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: united kingdom
Posted: 3rd Sep 2004 01:49
lol no aura answers quite a lot of my posts and i thank aura for that and thank u for the code i will try now

current projects
codename : tasgarad and discworld mysteries
life in the city watch
steve c
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: united kingdom
Posted: 3rd Sep 2004 02:35 Edited at: 3rd Sep 2004 02:38
thanks a lot hyritcher it works but nothing else does i can shoot but cant move cant look or anything pls help heres my code


current projects
codename : tasgarad and discworld mysteries
life in the city watch
steve c
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: united kingdom
Posted: 3rd Sep 2004 05:35
dont worry i have got it working yyyyeeeeeeeaaaaaa thanks hyricher there are a few things that still arent working so ill have to fix them but its great thanks

current projects
codename : tasgarad and discworld mysteries
life in the city watch
hyrichter
21
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 3rd Sep 2004 10:56
I'm glad you figured it out. I was going to show you that you had some loops inside of loops, but didn't have enough time to explain it.

Good luck

steve c
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: united kingdom
Posted: 3rd Sep 2004 19:44
thanks and thanks for the code so what is this current game your working on hyrichter is it kalepian invasion sounds good

current projects
codename : tasgarad and discworld mysteries
life in the city watch
hyrichter
21
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 3rd Sep 2004 23:42
Yes it is Kalepian Invasion. You can download a demo at http://www.hytekproductions.com/kalepia.zip Use the mouse to turn, arrow keys to strafe/move forward, 1 & 2 to switch weapons.

I've been thinking about putting it in the WIP board, but I want to get a little more done on it first.

steve c
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: united kingdom
Posted: 4th Sep 2004 00:22
downloading now

current projects
codename : tasgarad and discworld mysteries
life in the city watch
steve c
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: united kingdom
Posted: 4th Sep 2004 00:24
done now playing

current projects
codename : tasgarad and discworld mysteries
life in the city watch
steve c
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: united kingdom
Posted: 4th Sep 2004 00:30
its great its fun to just run around shooting the aliens its great good level cool menuscreen if u dont mind me asking how did you do your menuscreen because mine is just text it doesent move or anything

current projects
codename : tasgarad and discworld mysteries
life in the city watch
steve c
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: united kingdom
Posted: 4th Sep 2004 01:33
forget that last question u know i said i fixed it well ime not sure if i fixed it right can u tell me if i fixed it right because all i did was put my movement code and that into the loop ime not sure if that was the right thing to do heres my code


current projects
codename : tasgarad and discworld mysteries
life in the city watch
hyrichter
21
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 4th Sep 2004 05:17
To start with, I'd make it so your code doesn't look like copied and pasted snippedts from the 20-liners, please INDENT your code!!

In trying to look over your code, it was so hard to read, that I went through and properly indented everything and put some things in subroutines. Hopefully this will give you a good idea on how to organize your code so you know what's going on.

Since you were wondering about how I made my menu, I'll give you a brief explanation. I made some images and then textured some planes with my menu images. I then ghosted all the menu images. When the mouse is over a menu option, the ghosting for it is turned off. I'll leave it to you to figure out how to implement this, as my code for my menu is approaching 1000 lines, and it isn't near finished yet. (Most of that code is for all the menu options you can set.)

Now, here is your cleaned up code.


There was one part of your code I didn't understand, and that was in the main loop where you're hiding object 21 ten times per loop.

Quote: " for i=1 to 10
hide object 21
next i
"


If you need to hide objects 1 through ten, change your "hide object 21" line to "hide object i"

Anyway, I hope this helps you understand code organization. If you want people to help you, you need good, clean, organized code.

P.S. I don't want to come off sounding harsh or anything; I just want to help you learn.

steve c
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: united kingdom
Posted: 4th Sep 2004 05:44
thanks hyrichter ill have to get used to my code being like that but it works fine thanks ,one thing, was there anything in my code that u noticed that would slow my mouselooking down because when i move and then move the mouse to look somwhere else its really jotly and it stops moving forward when u do

current projects
codename : tasgarad and discworld mysteries
life in the city watch

Login to post a reply

Server time is: 2025-05-24 21:20:27
Your offset time is: 2025-05-24 21:20:27