Author Topic: BASIC game idea - WIP  (Read 3552 times)

0 Members and 1 Guest are viewing this topic.

Offline Morri

  • CPC6128
  • ****
  • Posts: 284
  • Country: nz
  • Liked: 237
  • Likes Given: 216
BASIC game idea - WIP
« on: 04:34, 19 May 16 »
Hi all,
I know it's only just been announced today but I'm pretty sure I will enter a game into this years #CPCRetroDev 2016 contest and I already have a good idea of what I'm going to do.

I'm going to enter into the BASIC category with a game I have been thinking about for awhile, in fact I already have a few of the routines I want to use working, namely the sprite handling (control codes) and hardware scrolling (OUT command).
I've still got a lot of work to do to make this a presentable, working game but the end of October should be achievable.

Anyway, this is where I require help. I was thinking about the possibility of adding in-game music to the program using DATA statements.
Is such a thing possible and is there anyone here who knows how to do this? I have no musical talent at all and would also need help to create the actual music.

Any help would be appreciated, even if it's pointing me to a thread / website etc with how to achieve such a result.

Cheers.
« Last Edit: 13:31, 25 May 16 by Morri »
Keeping it Kiwi since 1977

Offline Bytebreaker

  • CPC664
  • ***
  • Posts: 66
  • Country: de
  • Liked: 84
  • Likes Given: 77
Re: BASIC game idea - Help on music needed
« Reply #1 on: 12:23, 19 May 16 »
Hi Morri,


if you go to the demos section you find my little triangles demo (thanks for your tag scroll routine btw.).


Little Triangles Demo


Insert the dsk and just load"vscroll.bas" and list it.


The scrolltext is irrelevant but you will find there also a simple routine that plays data music based on a software interrupt while the scroller is moving. In theory, you could use all 3 interrupt intervals that Amstrad Basic is able to handle at at time and make music with 3 voices this way. But I am afraid there will be problems with smooth gameplay, then. Even my simple method required to find out a proper timing interval in order not to make the scrolltext stop. I am afraid you will need an Assembler routine for background music, but I am not sure, since I don't know the CPC that well, yet.


Edit:


I speak about lines 1760 to 1820. Here, an array is defined in which the music data gets injected. In line 1820 the interrupt is defined, i.e., the sound playing speed. The last three notes are zeroes to enforce a pause before the music loops.

In line 2410 we find the subroutine that actually plays the music. If all datas have been processed, reset array counter.
It's primitive and simple but maybe it's an inspiration to you. I developed the code directly on CPC so I have no text file to copy and paste here, sorry.

Edit 2:


I used an array for the music so I could easier use the RESTORE command for resetting the scrolltext datas only without getting in conflict with the music datas.










« Last Edit: 12:37, 19 May 16 by Bytebreaker »

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.919
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 1132
  • Likes Given: 1902
Re: BASIC game idea - Help on music needed
« Reply #2 on: 12:46, 19 May 16 »
Hi Morri,


I don't recall typing in any BASIC games where the music played during the game, but I haven't seen anyone make use of an EVERY or AFTER statement to play a tune in a BASIC game, not sure if it can be applied like that, the tune would have to be present in an Array and looped though on each time interval, but it's all theory and Assembly is out when it comes to these games.
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Offline andycadley

  • Supporter
  • 6128 Plus
  • *
  • Posts: 913
  • Liked: 445
  • Likes Given: 73
Re: BASIC game idea - Help on music needed
« Reply #3 on: 15:30, 19 May 16 »
CPC Basic has full support for interrupt driven music via the ON SQ mechanism. Since it uses a queuing system, it shouldn't have problems with timing.

Offline Morri

  • CPC6128
  • ****
  • Posts: 284
  • Country: nz
  • Liked: 237
  • Likes Given: 216
Re: BASIC game idea - Help on music needed
« Reply #4 on: 23:08, 19 May 16 »
Thanks for the answers so far.

I don't recall typing in any BASIC games where the music played during the game
Neither have I, the closest example I can find was Regreso al CPC which won the basic category in CPCRetroDev2015 last year. This game uses EVERY and DATA statements to produce a tune during the intro sequence. TBH if this is all that is possible I would be happy with that. Was only wondering if any program had gone one step further and had an actual in-game tune.

I used an array for the music so I could easier use the RESTORE command for resetting the scrolltext datas only without getting in conflict with the music datas.
Using arrays is a good idea, my only worry (without any tests) would be memory issues for longer tunes???

CPC Basic has full support for interrupt driven music via the ON SQ mechanism. Since it uses a queuing system, it shouldn't have problems with timing.

I have seen this command used in a few small demos, the 6128 manual I think but I don't undestand how it works. This was where I was hoping an expert might be able to help me develop a tune. ;D

 
Keeping it Kiwi since 1977

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.919
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 1132
  • Likes Given: 1902
Re: BASIC game idea - Help on music needed
« Reply #5 on: 11:14, 20 May 16 »
Should be worth checking the ON SQ actually.
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Offline SuTeKH/Epyteor

  • 6128 Plus
  • ******
  • Posts: 1.383
  • Country: 00
  • Liked: 1295
  • Likes Given: 2031
Re: BASIC game idea - Help on music needed
« Reply #6 on: 12:09, 20 May 16 »
I learned how to ON SQ from this type-in from ACU;
pak caverns &copy amstrad computer user (1986)
pak caverns &copy amstrad computer user (1986)

Both the loader and the main game use the same-style routine.

Offline Morri

  • CPC6128
  • ****
  • Posts: 284
  • Country: nz
  • Liked: 237
  • Likes Given: 216
Re: BASIC game - WIP
« Reply #7 on: 04:31, 25 May 16 »
I have now made super quick progress with my game and it is now in a playable state.
It has actually been a really fun game to make and is quite challenging to play. I must say for a Basic game it is actually quite good and I think it has some real replay-ability.  ;)

I still have a few things to finish but it's coming along nicely. Here is a list of to dos and on some of them I really need help. I have put any requests in bold and if anyone can help, please feel free to let me know.

1) I'm unsure if this will be a CPCRetroDev2016 entry as I developed it on my 6128 and it works fine in all emulators in 6128 mode, however when I change to 464 mode the graphics get all messed up.
I have had a couple of goes at fixing it but I don't know enough about the differences between Basic 1.0 and 1.1 and can't seem to fix it.
Text is not a problem, only my control code drawn characters. They work OK up until around halfway across the screen and then wrap down one line. Very annoying.

2) Finish the level design, I have done 7 out of 9 levels. Easy to do, just hard to come up with original and increasingly difficulty levels.

3) Figure out the music issue mentioned earlier. I have come to the conclusion that it will only be menu music with sound effects in game. Most of the sound effects are already done.
If anyone is interested in developing a tune for me in Basic using data statements, please let me know. I know the song I want to use, I just don't know what I'm doing here.

4) Continue to playtest and fix bugs.
Keeping it Kiwi since 1977

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.919
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 1132
  • Likes Given: 1902
Re: BASIC game - WIP
« Reply #8 on: 05:52, 25 May 16 »

I have had a couple of goes at fixing it but I don't know enough about the differences between Basic 1.0 and 1.1 and can't seem to fix it.
Text is not a problem, only my control code drawn characters. They work OK up until around halfway across the screen and then wrap down one line. Very annoying.


TAG does work a little bit differently on a 464, which is probably where your frustration is. The solution is to probably have TAG..TAGOFF around the character your drawing.
With the control codes, Devilmarkus once suggested using LOCATE because while they don't display themselves (unless your in TAG mode), they can fill up the screen and cause it to Roll.
The most unusual time I had to fix a BASIC 1.1 program, was HAL6128's Bouncing Ball which is in the Hisoft Pascal 4t thread. I had to change a screen address to the 464 equivalent, but was still not working. In that situation it was using CLS, but on a 464 because it was in TAG mode, PRINT CHR$(12) was being displayed, but the program worked fine when I used TAG..TAGOFF around the printed graphic.
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Offline Morri

  • CPC6128
  • ****
  • Posts: 284
  • Country: nz
  • Liked: 237
  • Likes Given: 216
Re: BASIC game idea - Help on music needed
« Reply #9 on: 06:40, 25 May 16 »
TAG does work a little bit differently on a 464, which is probably where your frustration is. The solution is to probably have TAG..TAGOFF around the character your drawing.
With the control codes, Devilmarkus once suggested using LOCATE because while they don't display themselves (unless your in TAG mode), they can fill up the screen and cause it to Roll.
The most unusual time I had to fix a BASIC 1.1 program, was HAL6128's Bouncing Ball which is in the Hisoft Pascal 4t thread. I had to change a screen address to the 464 equivalent, but was still not working. In that situation it was using CLS, but on a 464 because it was in TAG mode, PRINT CHR$(12) was being displayed, but the program worked fine when I used TAG..TAGOFF around the printed graphic.
I am using LOCATE to display these graphics, no MOVE or DRAW commands. I'll still try using TAG to see if it helps.
Keeping it Kiwi since 1977

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.919
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 1132
  • Likes Given: 1902
Re: BASIC game idea - Help on music needed
« Reply #10 on: 07:11, 25 May 16 »
I am using LOCATE to display these graphics, no MOVE or DRAW commands. I'll still try using TAG to see if it helps.


Oooh I'm sorry, I thought you were using TAG!  :o


You only need TAG if you're drawing to the Graphic Cursor Position (which uses MOVE), not Text Cursor Position (which uses LOCATE).


Ironically I wrote this little bouncing ball program a couple of weeks ago, which has a multicoloured ball. It's using Transparent mode & LOCATE to move around the screen, which seems to work on the 464. So perhaps compare that with your game I guess, unfortunately the Graphical Ball I'm using is 8x8.


Code: [Select]

10 MODE 0
20 SYMBOL 255,0,24,36,66,66,36,24,0
30 SYMBOL 254,0,0,24,52,60,24,0,0
40 SYMBOL 253,0,0,0,8,0,0,0,0
50 INK 0,0:INK 1,1:INK 2,2:INK 3,11:INK 4,18
60 GOSUB 4010
70 exit=0 : x=10 : y=10 : dir=1 : dir2=1
80 WHILE INKEY(18)=-1
90  v=1 : GOSUB 1010
100  CALL &BD19 : CALL &BD19
110  IF x=20 THEN dir=-1
120 IF x=1 THEN dir=1
130 IF y=25 THEN dir2=-1
140 IF y=1 THEN dir2=1
150 v=0 : GOSUB 1010
160 x=x+dir
170 y=y+dir2
180 WEND
190 CALL &BC02 : INK 1,26 : PEN 1
200 PRINT CHR$(22);CHR$(0);
210 MODE 2
220 END
1000 ' Draw or Erase Ball?
1010 PRINT CHR$(22);CHR$(v);
1020 IF v=1 THEN GOSUB 2010 ELSE GOSUB 3010
1030 RETURN
2000 ' Draw Ball
2010 PEN 1
2020 LOCATE x,y : PRINT CHR$(255);
2030 PEN 2
2040 LOCATE x,y : PRINT CHR$(254);
2050 PEN 3
2060 LOCATE x,y : PRINT CHR$(253);
2070 RETURN
3000 ' Erase Ball
3010 PEN 4 : LOCATE x,y : PRINT CHR$(207);
3020 RETURN
4000 ' Draw Background
4010 FOR y=1 TO 25
4020 PEN 4
4030 LOCATE 1,y
4040 PRINT STRING$(20,CHR$(207));
4050 NEXT y
4060 RETURN

* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Offline Morri

  • CPC6128
  • ****
  • Posts: 284
  • Country: nz
  • Liked: 237
  • Likes Given: 216
Re: BASIC game idea - WIP
« Reply #11 on: 14:10, 25 May 16 »
OK, I think I've worked out the problem. Basic 1.0 doesn't seem to be a fan of using the arrows to move the cursor around inside a PRINT command. After awhile it drops the cursor down by one line when it shouldn't. The below code should show the issue. I couldn't print arrows so you'll have to add those manually.
Does anyone know why this works in Basic 1.1 but not 1.0?

Code: [Select]
10 x=11
20 MODE 1:BORDER 0
30 a$="XX[insert down arrow/left arrow/left arrow]XX"
40 i$=LOWER$(INKEY$):IF i$="" THEN 40
50 IF i$="x" AND x<39 THEN GOSUB 90:x=x+2
60 IF i$="z" AND x>1 THEN GOSUB 90:x=x-2
70 LOCATE x,10:PRINT a$
80 GOTO 40
90 LOCATE x,10:PRINT"  [insert down arrow/left arrow/left arrow]  ":RETURN
Keeping it Kiwi since 1977

Offline Morri

  • CPC6128
  • ****
  • Posts: 284
  • Country: nz
  • Liked: 237
  • Likes Given: 216
Re: BASIC game idea - WIP
« Reply #12 on: 03:25, 26 May 16 »
Even using the control codes chr$(10) for move cursor down and chr$(8 ) for move cursor left produces the same bug.
I am confused. ???

Code: [Select]
10 x=11
20 MODE 1:BORDER 0
30 a$="XX"+CHR$(10)+CHR$(8 )+CHR$(8 )+"XX"
40 i$=LOWER$(INKEY$):IF i$="" THEN 40
50 IF i$="x" AND x<39 THEN GOSUB 90:x=x+2
60 IF i$="z" AND x>1 THEN GOSUB 90:x=x-2
70 LOCATE x,10:PRINT a$
80 GOTO 40
90 LOCATE x,10:PRINT"  "+CHR$(10)+CHR$(8 )+CHR$(8 )+"  ":RETURN
« Last Edit: 04:14, 26 May 16 by Morri »
Keeping it Kiwi since 1977

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.919
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 1132
  • Likes Given: 1902
Re: BASIC game idea - WIP
« Reply #13 on: 04:36, 26 May 16 »
Even using the control codes chr$(10) for move cursor down and chr$(8 ) for move cursor left produces the same bug.
I am confused. ???

Code: [Select]
10 x=11
20 MODE 1:BORDER 0
30 a$="XX"+CHR$(10)+CHR$(8 )+CHR$(8 )+"XX"
40 i$=LOWER$(INKEY$):IF i$="" THEN 40
50 IF i$="x" AND x<39 THEN GOSUB 90:x=x+2
60 IF i$="z" AND x>1 THEN GOSUB 90:x=x-2
70 LOCATE x,10:PRINT a$
80 GOTO 40
90 LOCATE x,10:PRINT"  "+CHR$(10)+CHR$(8 )+CHR$(8 )+"  ":RETURN

Yeah this has me stumped, unfortunately I can't test this at the moment. Perhaps instead of using the '+' for the chr use the semi-colon ';' instead?
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Offline Morri

  • CPC6128
  • ****
  • Posts: 284
  • Country: nz
  • Liked: 237
  • Likes Given: 216
Re: BASIC game idea - WIP
« Reply #14 on: 05:16, 26 May 16 »
Yeah this has me stumped, unfortunately I can't test this at the moment. Perhaps instead of using the '+' for the chr use the semi-colon ';' instead?
Interesting. The semi-colon does help. Still not perfect but getting there. Will continue looking tonight.
Keeping it Kiwi since 1977

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.919
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 1132
  • Likes Given: 1902
Re: BASIC game idea - WIP
« Reply #15 on: 07:19, 26 May 16 »
Interesting. The semi-colon does help. Still not perfect but getting there. Will continue looking tonight.


I've had the chance to have a look at your Example, I seem to be getting XXs across the screen regardless of BASIC 1.0 or 1.1, in 1.0 though in Line 50 where it's got x<39, BASIC 1.0 was getting up to that condition but incrementing. Changing x<38 would mean x will get to 39 and stop in BASIC 1.0. I tested this in BASIC 1.1 which seem to do the same.


The Xs were still messing up the screen though, I was using BASIC 1.1 at that stage, so I made some changes and came up with this:


Code: [Select]

10 x=11
20 MODE 1:BORDER 0
30 a$="XX"+CHR$(10)+CHR$(8 )+CHR$(8 )+"XX"
40 i$=LOWER$(INKEY$):IF i$="" THEN 40
50 IF i$="x" AND x<39 THEN GOSUB 90:x=x+1
60 IF i$="z" AND x>1 THEN GOSUB 100:x=x-1
70 LOCATE x,10:PRINT a$
80 GOTO 40
90 LOCATE x,10:PRINT" ";CHR$(10)+CHR$(8 );" ";:RETURN
100 LOCATE x,10:PRINT CHR$(9);" ";CHR$(10)+CHR$(8 );" ";:RETURN


I've changed the increment of x to add or subtract 1 in Lines 50 & 60, Line 90 takes care of the Left Side of the XXs and Line 100 takes care of the Right Side of the XXs. But when I tried that in BASIC 1.0 started getting problems which describes what you said earlier.


So this is what I came up with which works in BASIC 1.0:


Code: [Select]

10 x=11
20 MODE 1:BORDER 0
40 i$=LOWER$(INKEY$):IF i$="" THEN 40
50 IF i$="x" AND x<39 THEN GOSUB 90:x=x+1
60 IF i$="z" AND x>1 THEN GOSUB 100:x=x-1
70 LOCATE x,10:PRINT "XX";CHR$(10);CHR$(8 );CHR$(8 );"XX";
80 GOTO 40
90 LOCATE x,10:PRINT" ";CHR$(10);CHR$(8 );" ";:RETURN
100 LOCATE x,10:PRINT CHR$(9);" ";CHR$(10);CHR$(8 );" ";:RETURN


So not much change, I've altered Line 70c and deleted Line 30 and changed Lines 90 & 100 from '+' to ';'. But I forgot to see if it was the PRINT a$ in Line  70 which was the problem, there's no Semi-Colon after it, so earlier I didn't realise you declared the FourXs as a variable, so in that situation using Semi-Colon is a Syntax Error, but in Line 70 a Semi-Colon in the BASIC 1.1 program may make all the difference in BASIC 1.0.


Ps. I noticed you had a space after 'CHR$(8 )' didn't realise it at first, until I saw all those horrible emoji's appear! Most annoying! :(
« Last Edit: 07:23, 26 May 16 by AMSDOS »
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Offline Morri

  • CPC6128
  • ****
  • Posts: 284
  • Country: nz
  • Liked: 237
  • Likes Given: 216
Re: BASIC game idea - WIP
« Reply #16 on: 08:08, 26 May 16 »
Good job getting this to work. BASIC 1.0 really loves itself some semi-colon.  :P

Oh man, my code is going to need a major overhaul. Hopefully I can make it 464 compatible. Wish me luck!  :laugh:
Keeping it Kiwi since 1977

Offline andycadley

  • Supporter
  • 6128 Plus
  • *
  • Posts: 913
  • Liked: 445
  • Likes Given: 73
Re: BASIC game idea - WIP
« Reply #17 on: 08:21, 26 May 16 »
My guess would be that you've stumbled upon a bug in BASIC 1.0, although I don't think I've ever seen a definitive list of the changes in 1.1. Usually it's just the new commands and occasional mention of "various bug fixes". I guess you'd need to do a comparison of the disassembled code to find all of them.

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.919
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 1132
  • Likes Given: 1902
Re: BASIC game idea - WIP
« Reply #18 on: 13:18, 26 May 16 »
My guess would be that you've stumbled upon a bug in BASIC 1.0, although I don't think I've ever seen a definitive list of the changes in 1.1. Usually it's just the new commands and occasional mention of "various bug fixes". I guess you'd need to do a comparison of the disassembled code to find all of them.


It puzzles me why Amstrad continued selling 464s with BASIC 1.0 in them up until 1989, I'm not sure if this has been explained. In 1984 sure, Locomotive had to come up with a BASIC for the 464 and with the success of the 464, Locomotive could refine it, make it faster, address any issues & add some extras, which was ready in time for the 664.
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Offline Morri

  • CPC6128
  • ****
  • Posts: 284
  • Country: nz
  • Liked: 237
  • Likes Given: 216
Re: BASIC game idea - WIP
« Reply #19 on: 19:28, 27 May 16 »
Looks like I need to figure this out within strings. My code is way to reliant on strings and arrays for me to be able to change it. :'(
Keeping it Kiwi since 1977

Offline Morri

  • CPC6128
  • ****
  • Posts: 284
  • Country: nz
  • Liked: 237
  • Likes Given: 216
Re: BASIC game idea - WIP
« Reply #20 on: 00:04, 28 May 16 »
OK, printing character graphics as 2 separate lines fixes the problem / bug.
i.e. 1st row of sprite = chr$(a)+chr$(b)
2nd row = chr$(c)+chr$(d)
locate 1,1:print 1st row
locate 1,2:print 2nd row

I might base my code around this solution. Not ideal but I should be able to make it work with a 464 now (I hope).
Keeping it Kiwi since 1977

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.919
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 1132
  • Likes Given: 1902
Re: BASIC game idea - WIP
« Reply #21 on: 03:01, 28 May 16 »
This is what I came up with, which works on a 464, I just hope it doesn't complicate things for your game. I've simplified the process, so the Control Codes are singular (e.g. dn$=CHR(10) ), so when I print it now, those Control Codes have Semi-colons following and the Four "Xs" move across the screen.


This is reminiscent of an article published in The Amstrad User which is in Issue 18 on pages 26-28, which deals with Multicoloured Characters, but I think that guy was using a 664. They have used multiple Control codes to a string and are using Semi-colons when Printing those, but it appears the 464 may not like the Multiple Control Codes to a string, which may relate to how a 464 Passes Character String.


Code: [Select]

10 x=11
20 MODE 1:BORDER 0
30 blank$=" " : rht$=CHR$(9)
31 dude$="XX" : dn$=CHR$(10) : lft$=CHR$(8)
40 i$=LOWER$(INKEY$):IF i$="" THEN 40
50 IF (i$="x") AND (x<39) THEN GOSUB 90:x=x+1
60 IF (i$="z") AND (x>1) THEN GOSUB 100:x=x-1
70 LOCATE x,10:PRINT dude$;dn$;lft$;lft$;dude$
80 GOTO 40
90 LOCATE x,10:PRINT blank$;dn$;lft$;blank$;:RETURN
100 LOCATE x,10:PRINT rht$;blank$;dn$;lft$;blank$;:RETURN
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.919
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 1132
  • Likes Given: 1902
Re: BASIC game idea - WIP
« Reply #22 on: 14:13, 28 May 16 »
OK, printing character graphics as 2 separate lines fixes the problem / bug.
i.e. 1st row of sprite = chr$(a)+chr$(b)
2nd row = chr$(c)+chr$(d)
locate 1,1:print 1st row
locate 1,2:print 2nd row

I might base my code around this solution. Not ideal but I should be able to make it work with a 464 now (I hope).


Yes, it is valid on a 464, though I was using my previous program to use the locate, rather than the control codes, which worked. Lines 90 & 100 remained the same and still worked with the LOCATE version.
I made another version out of a Character I made back in the 90s which is 2 Characters Wide, 3 Characters in Height, because I only had one character I made a second by reversing it, so it faces Left when moving Left & Right for Right. I went back to singular Characters for the variable name and using the approach as I had above works fine on the 464. There's probably not a lot you'd get out of it, so won't worry about posting it, unless you want to see it. I also modified the inkey$ to inkey so Line 40 can be deleted and Line 50 can read:


if inked(1)<>-1 and ...


for the right arrow and,


if inkey(8 )<>-1 and ...


for the left arrow. The GOTO can then point to Line 50, so will perform better.
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.919
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 1132
  • Likes Given: 1902
Re: BASIC game idea - Help on music needed
« Reply #23 on: 13:28, 07 June 16 »
I have seen this command used in a few small demos, the 6128 manual I think but I don't undestand how it works. This was where I was hoping an expert might be able to help me develop a tune. ;D


I'm no maestro, but I found this BASIC game has a tune in it which is using the ON SQ GOSUB if you were looking for examples, the link to the PDF is on this page.
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3