Jump to content
IGNORED

Help with XB256 game


Sergioz82

Recommended Posts

7 hours ago, Sergioz82 said:

I have another couple of questions:

 

1) How do I implement a 6 digits score? I tried a basic for loop that assigns to a variant a starting value of 1000000 and increments it and it had no problem with printing the result so I thought it was managed by basic itself.

I used then a variant in the game for the score and it switches to negative values after 32768. 

 

 

 

An int variable has a limit of 32767 in compiled code, then it will turn to negative. So if you want to use 6 digits you necessary have to use 2 variables to store the score (some routines are needed to manage it). I've used this method in my Astrosmash for the TI since I wanted to use the same score system of the original game.
 
My suggestion is to simply add two 0 at the end of the displayed score. You are not replicating an existing game with a specific score sistems, so this will fit your needs and nobody will notice the use of the trick.


E.g. if you need to add 100 to the score, just add 1 to the variable used to store you score value and simply print 2 extra 0s at the end of the score displayed on the screen. With a single variable you'll able to have a score up of 3.276.700 points. Design your score with steps of 100, e.g. 100 for shooting blue alien, 200 for red alien, 500 for mothership, etc.

 

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

12 hours ago, Sergioz82 said:

Here I am again.. 

The game is proceeding, menu is complete and now it has joystick support (I realized that keyboard control is too tiring for the hand, it's not good for the gaming experience)

I have another couple of questions:

 

1) How do I implement a 6 digits score? I tried a basic for loop that assigns to a variant a starting value of 1000000 and increments it and it had no problem with printing the result so I thought it was managed by basic itself.

I used then a variant in the game for the score and it switches to negative values after 32768. 

 

2) Is there any guide about how to make sounds? I read some pdf scans of old manuals but they're mainly focused on music while I'm looking for sound effects. In those manuals they go like "this is the sound of explosion", "this is the sound of a bell chime" and so on but I'd rather like to read the principles behind it. For example how to choose the right number of frequencies to use in a single call sound,  how you actually choose the frequencies you need to replicate a bell and so on. I hope I explained myself ?

 

Thanks in advance 

 

 

What I do for the score is FIX a zero to the right of the value.  1 is 10  to 10 is 100.   etc.  You can also fix a second zero and shift your values left. 

 

Remember to calculate properly.  score=score+1  could be +10 or +100 based on how many fixed zeros you are using.

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

An integer can be -32768 to 32767. If you really want to use more than 5 digits, here is a way to get up to 8 digits, which would get you up to 99,999,999. It works, but is nowhere near as simple as the above suggestions. You divide the score into two values. In the program below I call them SCH and SCL. The increase in score is added to SCL. After the addition, if SCL is greater than 9999 then the overflow is added to SCH. These two numbers are converted to strings, padded with zeros and trimmed to a length of 4. Then the two together are concatenated and printed on the screen. The program adds 123 to the score. This works when compiled.


100 CALL CLEAR 
110 N=0 :: SCH=0 :: SCL=0 :: SCH$="0000" 
120 SCL=SCL+123 
130 IF SCL<10000 THEN 180 
140 T=INT(SCL/10000)
150 SCH=SCH+T :: SCL=SCL-T*10000 
160 SCH$="0000"&STR$(SCH)
170 SCH$=SEG$(SCH$,LEN(SCH$)-3,9)
180 SCL$="0000"&STR$(SCL)
190 SCL$=SEG$(SCL$,LEN(SCL$)-3,9)
200 CALL LINK("DISPLY",1,10,SCH$&SCL$)
210 CALL KEY(0,K,S):: IF S=0 THEN 210 
220 GOTO 120 

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

20 hours ago, TheBF said:

I studied electronic music way back in the age of analog Moog synthesizers where you have to build sounds with multiple oscillators and "voltage controlled" amplifiers. :) 

I think your question is outside the realm of programming and more in the realm of the physics of sound and music.

Once you understand what the sound is composed of you can code it or something close to it.  The alternative is experimenting (a lot) and listening carefully to the results.

 

Some concepts to put in your tool box.  "Envelope" of a sound refers to the shape the amplitude (volume) a sound would make over a period of time. 

You can think of the envelope in terms of "attack"; how fast the volume comes up, sustain; how long the sound stays at the same volume and decay; how fast the sound falls to silence.

 

To get the frequencies required to make a sound can be hard.  Artists use their ears and their wet-ware spectrum analyzer. (Everybody has that but with different specs) :) 

Technicians might require an electronic spectrum analyzer but that does not tell the entire story because a real sound unfolds over time with different parts coming into the mix over the envelope time ie: each part could have a separate envelope.  In computer games this level of detail is typically not needed but some sounds must have an envelope. Bells for example: fast attack with a long decay.

 

Apology if you know this already. If it is somewhat new then code examples and modification, trial and error, will probably be the way to go.

 

No need to apologize, you gave me a good advice, and also an idea: I downloaded Audacity for Windows. Then I downloaded some stock mp3 sounds I'd like to replicate in the game. 

The idea is to use its spectrum analyzer to, well, analyze the waveform and therefore envelope, amplitude and so on. 

  • Like 2
Link to comment
Share on other sites

5 hours ago, Sergioz82 said:

@tmop69 @1980gamer @senior_falcon

 

Thanks for your suggestions. 

 

I think I'll go for  tmop69/1980gamer's solution

LOL, didn't see @tmop69 response when I replied.  It was on the next page.

 

Astrosmash was on my list of games to try making for the TI.  But @tmop69did a great job with it.

I started Space Battle but gave up on it as I could not figure out the Cylon attack patterns. 

It is a playable demo,I should get back to it some day.  Someone did Night Stalker also.

 

Intellivision was my first console and the TI99/4A my first computer.  Both hold a special place in my heart.

Edited by 1980gamer
  • Like 4
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...