Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sun Dec 08, 2019 6:53 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Need Playtesters/codecheckers
PostPosted: Wed Mar 11, 2009 4:27 pm 
Offline
User avatar

Joined: Wed Dec 10, 2008 3:51 pm
Posts: 27
Hello all!

My game is slowly nearing completion. I'm wondering if anyone would like to play test it or code check it for me before I release it to my fan site (lots of members I wouldn't want to disappoint XD).

It's a very basic game. It's mainly just a maze game; you're driving a car through the roads and have to navigate to the other side. Later on I add pedestrians you have to avoid and towards the end I add cars. I think if I put a large effort into it, I'll be able to complete it by Saturday.


Right now my biggest problem is Music. I have two songs that find the sound file from My Computer. I don't know how to get it to find the sound file locally.

Dim f as FolderItem = GetFolderItem("C:\Documents and Settings\FrankJr\My Documents\My Games\Untitled\New Folder\fx\Sovereign.mp3")
If f = Nil Or Not f.Exists Then Return
Dim mySound as Sound = f.OpenAsSound
mySound.Play


Thats how it finds the song. It's getting it from my computer specifically. I don't know how to make it so it will find it globally, on anyones computer. I can test this by sending it to one of my various other computers. Right now if I try to run it, it crashes the program with an error message.
Thanks in advance!

Frankoman

_________________
Experience is the Teacher of all Knowledge ~ Julius Caesar


Top
 Profile  
Reply with quote  
 Post subject: Re: Need Playtesters/codecheckers
PostPosted: Wed Mar 11, 2009 11:16 pm 
Offline

Joined: Fri Sep 30, 2005 6:55 pm
Posts: 1522
You can use GetFolderItem("item name") to get a folderItem to a file that's in the same folder as your program.

_________________
Those who can, do. Those who can't, make excuses.


Top
 Profile  
Reply with quote  
 Post subject: Re: Need Playtesters/codecheckers
PostPosted: Thu Mar 12, 2009 3:49 am 
Offline

Joined: Mon Aug 14, 2006 9:33 pm
Posts: 1774
Quote:
I don't know how to make it so it will find it globally, on anyones computer.

At the risk of stating the obvious, you will need to include this sound file along with your program. Where you place it during your install is, somewhat, a matter of choice.
Using an absolute path as you are currently doing is not a very good way to access any file due to the risk of that path breaking with the many embedded folders.
One option is to place your file in a separate folder within your application's directory. A better method for accessing it is:
Dim f As folderitem = getfolderItem("My Sounds")  //looks for a folder in your app directory named my sounds.
if f <> NIl and f.exists Then
f = f.child("Sovereign.mp3"
if f <> Nil and f.exists Then
dim mySound As sound = f.OpenAsSound
if mySound <> Nil Then
mySound.play
End if
Else
//handle the file missing error here
end if
Else
//handle the folder missing error here
End if

You can also opt to store your sound in SpecialFolder locations (see the LR)

_________________
Roger Clary
Class One Software
Educational Software for Lifelong Learning
http://www.classonesoftware.com


Top
 Profile  
Reply with quote  
 Post subject: Re: Need Playtesters/codecheckers
PostPosted: Thu Mar 12, 2009 11:05 am 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
You could also drag the sound file into your project and let RB take care of the details. You can treat the sound as a global property:

Soveriegn.Play

Tim


Top
 Profile  
Reply with quote  
 Post subject: Re: Need Playtesters/codecheckers
PostPosted: Fri Mar 20, 2009 12:44 am 
Offline

Joined: Wed Nov 30, 2005 8:22 pm
Posts: 227
Location: L.I., New York
Always be careful when dragging sound files into the project as this can cause a problem if the sound file is too big (I have had many experiences with that).

Plus the sound gets embedded into the application.

I always find it better to use classone's method using "GetFolderItem". As an added bonus, the sound can then be changed without having to recompile you game.


Top
 Profile  
Reply with quote  
 Post subject: Re: Need Playtesters/codecheckers
PostPosted: Sat Mar 28, 2009 9:11 pm 
Offline
User avatar

Joined: Wed Dec 10, 2008 3:51 pm
Posts: 27
Thanks guys, that worked beautifully!




I just need to finish two more levels and need to update my options menu. When thats all done I should be good to go!

_________________
Experience is the Teacher of all Knowledge ~ Julius Caesar


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group