TFH's new project - Shooting Stars 2022 - Help Wanted

페이지 1/4
| 2 | 3 | 4

By tfh

Prophet (3256)

tfh의 아바타

01-02-2022, 20:41

A long long time ago, when TFH was a little TFH (12 or 13 years old), I wrote a simple game in basic called "Vallende Sterren" (Shooting Stars). It got published in MSX-Info as a Type In Listing.
In 2016 I made an English version and in 2020 I made a version in 10 Lines for the 10 Liner Basic Challenge. You can find the different versions here: https://homebrew.file-hunter.com/index.php?id=shootingstars

I've decided it was time to make a definitive version. I've started out with fixing some of the issues / bugs that were in the previous versions. I've also made 4 8-color Screen 5 backgrounds for this first 4 levels. I can re-use these images with different colors for other levels. Right now the only difference between the levels is the speed of the stars & ship.
This is now where I'm at: https://test.file-hunter.com/

Things I still need to do:

* Make a nice logo
* Make a "welcome screen"
* Create a story - goal so you have something to work to.
* Maybe move to KUN-Basic in case I need to more speed
* Add joystick support
* Think of some extra stuff

Since I'm only able to do stuff in BASIC, I'll be kind of limited in what I can do. But... at the moment I'm having fun and also learning new stuff, so :) TFH is happy.
I could use some help though: I tried making some music, but... the results were somewhat "disapointing". Is there someone who maybe has one or two tracks somewhere lying around I could use, preferably in Arkos Tracker?
Also... Please feel free to give any input you like. I don't know what I will/am able to add :)

Login or 등록 to post comments

By Samor

Prophet (2162)

Samor의 아바타

01-02-2022, 22:03

it already looks way prettier than before, and the initial pace is more friendly.
As for a story, maybe something like "The galaxy is falling apart! The Galaxy Hunter, in his ruthless quest for interstellar domination, is destroying our beloved star systems! We need you to catch the falling stars and restore peace and order in the galaxy!"

By tfh

Prophet (3256)

tfh의 아바타

01-02-2022, 22:08

Samor wrote:

it already looks way prettier than before, and the initial pace is more friendly.
As for a story, maybe something like "The galaxy is falling apart! The Galaxy Hunter, in his ruthless quest for interstellar domination, is destroying our beloved star systems! We need you to catch the falling stars and restore peace and order in the galaxy!"

ROFL... That was indeed more or less the "storyline" I had in mind. A bit standard, but ... ah well... we'll see. I really DO like The Galaxy Hunter (TGH!) Smile Smile
The starting pace indeed quite a bit better. I want to try to do the gameplay loop in KUN Basic, hoping that I can make it a bit smoother (at higher speeds) and also can create some different speeds (and star-spreads) in between.

By Samor

Prophet (2162)

Samor의 아바타

01-02-2022, 22:56

If we take the story a bit further, I think our hero would be Arnaud the Astronaut. Stop me if I take jokes too far.

By tfh

Prophet (3256)

tfh의 아바타

01-02-2022, 23:14

Samor wrote:

If we take the story a bit further, I think our hero would be Arnaud the Astronaut. Stop me if I take jokes too far.

LOL.. nah, I am not going to use my own name in the game Smile
Anyway -> Added a "nice"(??) logo Smile

By tfh

Prophet (3256)

tfh의 아바타

02-02-2022, 20:20

OK, I am running into a little problem I can't solve. In my first level, everything works fine. In the 2nd level, my sprite is messed up. But... I get different results depending on the emulator & hardware.

In WebMSX the sprite is messed up:

In OpenMSX (NMS-8250) it works as I expected:

On real hardware (NMS-8280) I get a star (a white copy of sprite 0) some 30 pixels to the left of my starship:

This is my BASIC listing:

10 CLS:KEYOFF:COLOR2,1,1:PRINT"Shooting Start 2022":PRINT"Arnaud de Klerk | The File-Hunter"
20 PRINT:PRINT"Version: 02-02-2022"
30 LOCATE5,10:PRINT"One Moment Please"
40 FORA=0TO500:NEXT
50 DEFINTA-Z:SCREEN5,,0:COLOR2,0,0:OPEN"GRP:"AS#1:ONSPRITEGOSUB390:ONINTERVAL=6GOSUB640
60 A=STICK(0):' Controller
70 C=0:' Y-Axis Star
80 L=0:' X-Axis Star
90 D=128:' X-Axis Ship
100 T=0:' Number of fallen stars
110 P=0:' Level
120 E=0:' Color Set
130 S=0:' Score
140 U=2:' Star Speed
150 V=3:' Ship speed
160 O=0:' Horizontal Offset
161 I=0:' Interval on/off
170 ' X=Level Countdown
180 DEFUSR=&H41:Z=USR(0):GOSUB530:SETPAGE3,3:CLS:VDP(9)=VDP(9)OR2
190 BLOAD"FONY.SC5",S:RESTORE500
200 FORE=0TO15:READR,G,B:COLOR=(E,R,G,B):NEXT:DEFUSR=&H44:Z=USR(0)
210 SETPAGE3,0:BLOAD"screen51.SC5",S
220 SETPAGE3,1:BLOAD"screen52.SC5",S
230 SETPAGE3,2:BLOAD"screen53.SC5",S:DEFUSR=&H41:Z=USR(0)
240 SETPAGE0,3:BLOAD"screen54.SC5",S:VDP(9)=VDP(9)AND253
250 'Levels
260 IFP=0THENGOSUB430:SETPAGE0,0:DEFUSR=&H44:Z=USR(0):GOSUB560:GOTO340
270 IFP=1THENU=3:V=3:GOSUB440:SETPAGE1,1:GOSUB560:GOTO340
280 IFP=2THENU=4:V=4:GOSUB450:SETPAGE2,2:GOSUB560:GOTO340
290 IFP=3THENU=3:V=3:GOSUB460:SETPAGE3,3:GOSUB560:I=1:GOTO340
300 IFP=4THENU=4:V=3:GOSUB440:SETPAGE0,0:GOSUB560:I=1:GOTO340
310 IFP=5THENU=5:V=4:GOSUB450:SETPAGE1,1:GOSUB560:I=1:GOTO340
320 GOTO570
330 ' Main Game Routine
340 IFI=1THENINTERVALON
341 GOSUB610:SPRITEON:FORX=25TO1STEP-1
350 A=STICK(0):PUTSPRITE0,(L,C),7,0:C=C+U:PUTSPRITE1,(D,200),6,1
360 IFA=3THEND=D+VELSEIFA=7THEND=D-V
370 IFC>200THENC=0:GOSUB410:NEXTELSEGOTO350
380 INTERVALOFF:P=P+1:GOTO260
390 ' Star Cought
400 SPRITEOFF:S=S+1:GOSUB590:PUTSPRITE0,(0,0),0:GOSUB600:GOSUB610:SPRITEON:C=201:RETURN
410 T=T+1
420 GOSUB600:GOSUB610:RETURN
430 RESTORE470:FORE=6TO15:READR,G,B:COLOR=(E,R,G,B):NEXT:COLOR=(2,0,7,0):RETURN
440 RESTORE480:FORE=6TO15:READR,G,B:COLOR=(E,R,G,B):NEXT:COLOR=(2,7,0,0):RETURN
450 RESTORE490:FORE=6TO15:READR,G,B:COLOR=(E,R,G,B):NEXT:COLOR=(2,0,0,7):RETURN
460 RESTORE470:FORE=6TO15:READR,G,B:COLOR=(E,R,G,B):NEXT:COLOR=(2,0,0,7):RETURN
470 DATA 7,7,7,6,0,6,0,1,0,1,1,0,4,1,1,6,2,1,7,3,1,7,4,2,6,6,4,7,6,3:' Red
480 DATA 7,7,7,6,0,6,0,1,2,1,2,3,1,3,5,3,4,4,5,5,6,4,6,6,6,7,7,7,7,7:' Blue
490 DATA 7,7,7,6,0,6,0,2,1,1,3,2,1,5,3,3,4,4,4,6,5,4,6,6,7,7,6,7,7,7:' Green
500 DATA 0,0,0,1,0,0,1,1,1,2,2,2,3,0,2,4,1,2,3,3,3,4,2,3:' Fony
510 DATA 4,3,3,4,4,4,5,3,4,5,5,5,6,4,5,6,5,5,6,6,6,7,7,7:' Fony
520 'Set Sprites
530 SPRITE$(0)=CHR$(16)+CHR$(56)+CHR$(124)+CHR$(254)+CHR$(124)+CHR$(56)+CHR$(16)
540 SPRITE$(1)=CHR$(129)+CHR$(129)+CHR$(129)+CHR$(195)+CHR$(165)+CHR$(153)+CHR$(255)+CHR$(255)
550 RETURN
560 GOSUB530:GOSUB580:GOSUB590:GOSUB600:RETURN
570 SCREEN0:END
580 PSET(0,0),1:PRINT#1,"SCORE:":RETURN
590 INTERVALOFF:PSET(42,0),1:PRINT#1,"    ":PSET(42,0),1:PRINT#1,S*10:IFI=1THENINTERVALON:RETURNELSERETURN
600 INTERVALOFF:PSET(224,0),1:PRINT#1,"   ":PSET(224,0),1:PRINT#1,T:IFI=1THENINTERVALON:RETURNELSERETURN
610 FORM=LTO0STEP1:NEXTM:L=INT(RND(-TIME)*230)+10
620 RETURN
630 'Spacequake
640 O=INT(RND(-TIME)*8):SETADJUST(O-4,0):D=D+(O-4):PUTSPRITE1,(D,200),6,1:RETURN

What am I doing wrong here (besides breaking all coding rules and stuff)?

By Samor

Prophet (2162)

Samor의 아바타

02-02-2022, 22:30

On the SX-2, the sprite is messed up AND a copy of the star is displayed through the sprite.
Funny how it's different everywhere.

Ran it a second time and now it was just like the webmsx behaviour.

By turbor

Champion (507)

turbor의 아바타

02-02-2022, 23:18

It has been a long time since I did BASIC, but some things that I should do

  • screen 5,0 : explicitely state the size of the sprites 8x8,no magnification
  • DEFUSR=&H41:Z=USR(0) => disable screen display can be done faster and simpler with vdp(1)=vdp(1)and191
  • DEFUSR=&H44:Z=USR(0) => enable screen display can be done simpler with vdp(1)=vdp(1)or64
  • FORM=LTO0STEP1:NEXTM=>drop step1 and the M after next or did you mean step -1? because counting from any pos interger to 0 will immediately finish after one loop with step 1. I can't fathom what purpose that loop serves... Big smile

Also slightly faster version of IFA=3THEND=D+VELSEIFA=7THEND=D-V is to write it as
D=D+V*(-(A=3)+(A=7))

Now for the sprite issues.
You are using screen 5 so it is sprite mode2 and you need to set a sprite color table and all.
Now the good news is that BASIC is hiding this for you in the putsprite command but IIRC sprites and different pages can cause BASIC to screw up with the vram addresses.

I would (not tested and as as quick fix) try to recreate the sprite$(0) ans sprite$(1) each time you you switch pages. This way BASIC needs to rewrite the vram for the current page setting.

By Samor

Prophet (2162)

Samor의 아바타

03-02-2022, 00:47

I tested in a few emulators and in both openmsx and bluemsx there is sprite corruption in msx2+ mode that is not there in msx2 mode (makes sense as the same thing happens on the sx-2, which is a 2+). Webmsx seems to be the only emulator that also shows the corruption in msx2 mode which might indicate that the msx2 machine configuration in webmsx is different.

By gdx

Enlighted (5834)

gdx의 아바타

03-02-2022, 08:39

VDP(1)=VDP(1)AND191:VDP(1)=VDP(1)OR64 is slower than DEFUSR=&H41:Z=USR(0):DEFUSR=&H44:Z=USR(0)

And that's normal because DEFUSR just executes a BIOS routine in machine language. VDP(1)=VDP(1)... performs a logical operation on variables in BASIC language.

You can see it yourself with the following programs.

10 TIME=0
20 FOR I=0 to 1000
30 VDP(1)=VDP(1)AND191:VDP(1)=VDP(1)OR64
40 NEXT
50 PRINT TIME
10 TIME=0
20 FOR I=0 to 1000
30 DEFUSR=&H41:Z=USR(0):DEFUSR=&H44:Z=USR(0)
40 NEXT
50 PRINT TIME

By Jipe

Paragon (1572)

Jipe의 아바타

03-02-2022, 09:58

the sprite defect appears with the instruction SET PAGE 1,1
if we replace the SET PAGE 1,1 by COPY(0,0)-(255,211),1 to (0,0),0 the sprite is preserved
the set page must destroy something in the pattern of the sprites

페이지 1/4
| 2 | 3 | 4