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 / Bullets and sounds

Author
Message
gasolin
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location:
Posted: 29th Dec 2002 19:01
Hi, Now I got a real problem =)
When I have added sound to my shoots and was going to learn Math Collision the game f**ked up. Then bullets goes some meters then It stopped in the air and the fire sound is looping. The bullet that hangs in the air stay there until I fire a new bullet, and then the same thing happends. Anyone god an idea how to fix it?


Sync On
Sync Rate 30
Hide Mouse
Backdrop on
Set camera range 1,5000

Fog on
Fog distance 4000
Fog color RGB(128,128,128)
Color Backdrop RGB(128,128,128)

REM Make matrix
Make matrix 1,10000,10000,20,20

REM texture matrix
Load image "grass09.bmp",1
Prepare matrix texture 1,1,1,1
Fill matrix 1,0,1

REM Randomize the matrix
randomize matrix 1,125
X#=5000
Z#=5000

REM Make Gun
Make Object Cylinder 1,2
Xrotate Object 1,90
Fix object pivot 1
Scale object 1,100,100,500
Position object 1,0,-7,15
Lock object on 1

REM Make Bullet
Make Object sphere 2,2
Hide Object 2

REM Load Sound
rem Load Sound "crickets.wav",1
rem Loop Sound 1

Load 3Dsound "fireball2.wav",2

REM Main loop
Do
OldCamAngleY# = CameraAngleY#
OldCamAngleX# = CameraAngleX#
CameraAngleY# = WrapValue(CameraAngleY#+MousemoveX()*0.2)
CameraAngleX# = WrapValue(CameraAngleX#+MousemoveY()*0.2)

REM Control input for camera
If Upkey()=1
XTest# = newxvalue(X#,CameraAngleY#,10)
ZTest# = newzvalue(Z#,CameraAngleY#,10)
If XTest#>0 and XTest#0 and ZTest#0 and XTest#0 and ZTest#0 and XTest#0 and ZTest#0 and XTest#0 and ZTest# 0
Dec BulletLife
Move Object 2,20
bX#=Object position X(2)
bY#=Object position Y(2)
bZ#=Object position Z(2)
Position sound 2,bX#,b#Y,bZ#
set cursor 10,10
if Sqrt((mX# - bX#)^2 + (mY#+25 - bY#)^2 + (mZ# - bZ#)^2) 270

if CameraAngleX#-270 > 90 then CameraAngleX#=270
else
if CameraAngleX# > 90 and CameraAngleX#-270
gasolin
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location:
Posted: 29th Dec 2002 19:07
hmm I never can post hole codes.. here is the code:
http://home.no/gasolin/misc/Math%20collision.txt

gasolin
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location:
Posted: 30th Dec 2002 01:32
Comman please ANYONE help me out!

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 30th Dec 2002 01:52
Your best bet is to put the code and media into a zip file for downloading. I'll have a play with the code if you do that.
gasolin
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location:
Posted: 30th Dec 2002 02:40
Well this is the files you need
(It just 2 test sound)

http://home.no/gasolin/misc/math%20collision.zip

Attreid
21
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 31st Dec 2002 11:05
try this new code :



'cause there wasn't the texture of the ground in the zip, I made one with create bitmap
i added a sound ; the sound 3, look at it ^^
the var. impact is used to know if the sound 3 is positionned and played
the var. impact become 0 when you shoot again

I'm following John, but I'm not john.
Lol, it is funnier in french
gasolin
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location:
Posted: 31st Dec 2002 21:43
Attreid: I was going to test run your code but I got an error at the line dot x,y,rgb(0,rnd(255),0)
Error msg: PARAMETER MISMATCH. DOT EXPECTS INTERGER,INTERNGER

John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 31st Dec 2002 21:44
You need to set the ink color before making the dot.

RPGamer

Current - RPG: Eternal Destiny : Help Wanted!
Upcoming- MMOFPS- Paintball Game: HELP WANTED!
Http://halbrosproductions.netfirms.com
gasolin
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location:
Posted: 1st Jan 2003 06:51
Okay, and how do I do that?

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 1st Jan 2003 17:34
Like this:

ink rgb(0,rnd(255),0),0
dot x,y
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 1st Jan 2003 17:58
Good job :p

I believe in figuring stuff out for yourself. Usually just takes a 2 second trip to the manual and read the command.
Like my sig

RPGamer

Current - RPG: Eternal Destiny : Help Wanted!
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy!
gasolin
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location:
Posted: 1st Jan 2003 19:02
Okey thx, know it working like i want it to!

Login to post a reply

Server time is: 2024-11-23 20:31:27
Your offset time is: 2024-11-23 20:31:27