Bliss - Stunts Track Editor
Bliss - Stunts Track Editor
I'm thinking it's time that I start making games in FreeBasic. I'll soon be posting some games, he, he. What I have now, that I would like to post, is not exactly a game. It's an editor, but a very special one. Do you know the 1990s game Stunts? If you do, you probably also know the Stunts online racing community (check http://zak.stunts.hu if you're interested). Well, I've been part of it for quite some time and I'm the one who made the track editor we use. I made it in FreeBasic, it's free software and it uses no third party software (i.e.: libraries). It can run in FreeDOS, GNU/Linux (both 32bit and 64bit) and Windows and it's completely portable, which is the way I like making software.
Hope you guys like it. Take a look:
http://www.dimioca.com/bliss/
And now I'll start working on some new game :)
Hope you guys like it. Take a look:
http://www.dimioca.com/bliss/
And now I'll start working on some new game :)
Re: Bliss - Stunts Track Editor
I did the some thing ~10 years ago (in Powerbasic, I think). I'll try to find the code.
Re: Bliss - Stunts Track Editor
Looks interesting.
The source code editor you used places the LF and the end of a line but not the CR, so FBEdit puts everything on one line.
I am sure there are many cures for this but here is one (obviously, replace the filename paths as necessary):
The source code editor you used places the LF and the end of a line but not the CR, so FBEdit puts everything on one line.
I am sure there are many cures for this but here is one (obviously, replace the filename paths as necessary):
Code: Select all
Const As String INFILE = "C:\Freebasic Stuff\StuntEditor\source\Bliss.bas"
Const As String OUTFILE = "C:\Freebasic Stuff\StuntEditor\source\yBliss.bas"
Dim As Integer fNum, n, oNum
Dim As Byte c
Dim As String s ' temp. String
fNum = FreeFile()
Open INFILE For Binary As #fNum
oNum = FreeFile()
Open OUTFILE For Binary As #oNum
While Not Eof(fNum) ' here: all the 'action' takes place
Line Input #fNum, s ' stops reading, at chr(10) - LINUX
Print #oNum, s ' writes, with chr(13, 10) - WINDOWS
Wend
Close #oNum
Close #fNum
Last edited by sancho2 on May 20, 2017 1:50, edited 1 time in total.
Re: Bliss - Stunts Track Editor
@sancho2,
below, a simplified version, of the while .. wend loop (no additional checks needed!).
Files are opened "for Input" and "for Output" (no binary needed).
And, of course, a lot faster (line by line, instead of: byte by byte):
below, a simplified version, of the while .. wend loop (no additional checks needed!).
Files are opened "for Input" and "for Output" (no binary needed).
And, of course, a lot faster (line by line, instead of: byte by byte):
Code: Select all
' f1 and f2 are the open file numbers
Dim As String s ' temp. String
While Not Eof(f1) ' here: all the 'action' takes place
Line Input #f1, s ' stops reading, at chr(10) - LINUX
Print #f2, s ' writes, with chr(13, 10) - WINDOWS
Wend
Re: Bliss - Stunts Track Editor
Thank you Mr Swiss.
I did not realize that Line Input could get its end of line from the line feed character only.
I did not realize that Line Input could get its end of line from the line feed character only.
-
- Posts: 538
- Joined: Jul 15, 2005 4:13
Re: Bliss - Stunts Track Editor
I didnt know you could use line input on a file opened in binary....so im assuming it inputs until end of line character??? Thats pretty neat!!
-
- Posts: 538
- Joined: Jul 15, 2005 4:13
Re: Bliss - Stunts Track Editor
Im actually working on a couple things that read wav files in binary, and bitmaps in binary.
Re: Bliss - Stunts Track Editor
Oh... well, I didn't realise I had published it in Linux format. Well, Geany can be configured to insert the CR/LF line end instead. I usually don't realise when a text file is one or the other format because I'm always on Linux, but this is not the first time somebody makes me notice and I change it. It happened to me with the doc file for that same program, as a matter of fact. Thanks, guys.
-
- Posts: 2338
- Joined: May 31, 2005 9:59
- Location: Croatia
- Contact:
Re: Bliss - Stunts Track Editor
I adored Stunts back in the day. It's great to see there is still an active community around that game.
-
- Posts: 2958
- Joined: Jun 02, 2015 16:24
Re: Bliss - Stunts Track Editor
Very appealing ;) A nice classics anyway!xlucas wrote: Hope you guys like it. Take a look:
http://www.dimioca.com/bliss/
And now I'll start working on some new game :)
Re: Bliss - Stunts Track Editor
Thanks, guys. Yes, it's very nice to be able to write a project for that game. If it weren't for the community inspiring it, I wouldn't have made the editor and I can say I've learnt much from developing it.