You are not logged in.
Lost Password?


Register To Post



 Bottom   Previous Topic   Next Topic

#1
Soviet Union 2010 for DOS
Posted on: 2010/11/17 21:09
PVB Elite
Joined 2008/12/28
Slovenia
635 Posts
Highscore Top ScoreHighscore Top ScoreCoderContributor10+ Game RatingsLong Time User (11 Years) App CoderPVBCC 2010 EntryPVBCC 2013 Entry
A work in progress. It's mostly identical to the Virtual Boy version, except that all data is stored in a file rather than being hardcoded into the game, and the fact I had to write my own graphics code. Other than that it's pretty much just translating C to BASIC.

It will probably have more levels, a level editor, sound effects, and maybe even music and multiplayer. These features may be later ported to the Virtual Boy, depending on how much bribe help and support I get.

Why am I developing for DOS? Because there's a DOS emulator for just about every operating system, which makes it cross-platform :)

Attach file:



png  sudos.png (1.76 KB)
930_4ce4362f2b6d8.png 640X350 px
Top

#2
Re: Soviet Union 2010 for DOS
Posted on: 2010/11/18 2:13
VUE(xpert)
Joined 2006/9/29
USA
267 Posts
CoderLong Time User (13 Years) PVBCC 2010 3rd
Cool! How much work was it to port your code to Basic? That wouldn't have been my first choice, I would imagine it would have been easier to port it to DOS while staying in C. You might also consider writing it in Java. That way your code would be both cross-platform and web enabled.
Top

#3
Re: Soviet Union 2010 for DOS
Posted on: 2010/11/18 7:35
PVB Elite
Joined 2003/7/26
USA
1469 Posts
PVBCC EntryCoderContributorSpecial AchievementTop10 PosterHOTY09 EntryLong Time User (15 Years) App Coder20+ Game RatingsPVBCC 2013 Entry
I would also like to know "why BASIC?" but also: what dialect of BASIC are you using?

Another cross-platform game programming environment (optionally with yet another language) is the Gosu library (http://www.libgosu.org/). It's written in/for C++, but it also has Ruby bindings. It's basically an object-oriented, 2-D graphics API on top of OpenGL, along with KB/joystick input and sound/music playing.

I find Ruby much more fun to write than BASIC (or C, for that matter) and it's quite powerful, especially if your video card is doing all the heavy lifting, graphics-wise.
Top

#4
Re: Soviet Union 2010 for DOS
Posted on: 2010/11/18 14:37
PVB Elite
Joined 2008/12/28
Slovenia
635 Posts
Highscore Top ScoreHighscore Top ScoreCoderContributor10+ Game RatingsLong Time User (11 Years) App CoderPVBCC 2010 EntryPVBCC 2013 Entry
Quote:

How much work was it to port your code to Basic?


Not much (but I'm not finished yet). Compare


while(Lives)  // Gameplay loop
      
{
        if(!
Cycle)
        {
          
MoveShip();
          
HeadsUpDisplay();
        }

        
Cycle++;

        
LowBatteryIcon();
        
CollisionDetection();
        
PlayerControl();
        
ThingAI();           // Thing behavior
        
ProjectileAI();      // Projectile behavior
        
AutoRemoveThings();  // Removal of things outside the screen
        
AutoCreateThing();   // Creation of new things
        
Slowdown();          // Maintain a consistent game speed
        
        
if(!(Cycle 32)) UpdateBackground();
      }


with


DO WHILE Lives 0  'Gameplay loop
      IF Cycle = 32767 THEN Cycle = 0
      IF Cycle = 0 THEN HeadsUpDisplay
      
      Cycle = Cycle + 1

      RedrawStuff  '
Graphics code
      CollisionDetection
      PlayerControl
      ThingAI           
'Thing behavior
      ProjectileAI      '
Projectile behavior
      AutoRemoveThings  
'Removal of things outside the screen
      AutoCreateThing   '
Creation of new things
      Slowdown          
'Maintain a consistent game speed

      IF Cycle AND 32 <> 0 THEN UpdateBackground
    LOOP


or


int AutoRemoveThings 
()
{
  
// Checks each thing's Y and removes it if it's outside the screen.

  
char i;  // Thing number.
  
char j;  // Object number.

  
for(0<= kMaxThingsi++)
  {
    if(
Thing[i].Used)
    {
      if(
Thing[i].224)
      {
        
Thing[i].Used 0;  // The thing is officially no longer used.
        
Thing[i].Direction 0;

        
// Make its OBJs invisible.
        
for(0<= 15j++)
        {
          
OBJ_SET_VIS(16 + (<< 4), 0);
        }
      }
    }
  }
}


with


SUB AutoRemoveThings
FOR i% = 0 TO kMaxThings
  
IF Thing(i%).Used THEN
    
IF Thing(i%).224 THEN  'Notice there's no need to hide OBJs the thing simply won't be drawn if it's not used.
      
Thing(i%).Used FALSE
      Thing
(i%).Direction 0
    END 
IF
  
END IF
NEXT i%
END SUB


Quote:

That wouldn't have been my first choice, I would imagine it would have been easier to port it to DOS while staying in C.


Maybe. Maybe not. I'm much more skilled and productive in BASIC. Debugging with an interpreter is way easier. Both are procedural, imperative, structured languages anyway.

Quote:

You might also consider writing it in Java. That way your code would be both cross-platform and web enabled.


I don't have an interest in Java (or any class-based object-oriented language) and I think the two advantages you mentioned are way overrated. It's like constructing a (human) language that only has features that exist in all languages and everybody can understand. You'd get nowhere.

Quote:

what dialect of BASIC are you using?


QuickBASIC. In case I ever want to do a native Windows port I can easily do it in FreeBASIC.
Top

#5
Re: Soviet Union 2010 for DOS
Posted on: 2011/3/16 12:16
VUE(xpert)
Joined 2010/2/15
Netherlands
250 Posts
Long Time User (10 Years)
It's funny how such an obsolete language can still be relevant if all you want to do is make a simple game. It shows that you really don't need much if the game is just that - simple.

Good luck with the port, hoping to play it on my real DOS machine some day. :P
Top

 Top   Previous Topic   Next Topic


Register To Post