The Re-Make of Alien Dropout ZX81

Started by Baggey, November 09, 2024, 18:05:59

Previous topic - Next topic

Baggey

Hi @RemiD, Christmas is coming soon I have three Spare weeks for projects. I look forward to playing with code and translating into BlitzmaxNG.

Kind Regards Baggey
Running a PC that just Aint fast enough!? i7 4Ghz Quad core 32GB ram  2x1TB SSD and NVIDIA Quadro K1200 on 2 x HP Z24's . DID Technology stop! Or have we been assimulated!

Windows10, Parrot OS, Raspberry Pi Black Edition! , ZX Spectrum 48k, C64, Enterprise 128K, The SID chip. Im Misunderstood!

RemiD

#61
@Baggey >>

the code is almost finished, and i have already recorded the sounds, i just have to add the code to play the sounds.

i have had others things to do these past days, but i will try to finish it this week and post the final bb code and the images / sounds.

then you can improve it as you want...

Baggey

Quote from: RemiD on December 09, 2024, 22:07:12@Baggey >>

the code is almost finished, and i have already recorded the sounds, i just have to add the code to play the sounds.

i have had others things to do these past days, but i will try to finish it this week and post the final bb code and the images / sounds.

then you can improve it as you want...
Im hoping Finally i may just get the idea on how to go about making my own Games ;)
Running a PC that just Aint fast enough!? i7 4Ghz Quad core 32GB ram  2x1TB SSD and NVIDIA Quadro K1200 on 2 x HP Z24's . DID Technology stop! Or have we been assimulated!

Windows10, Parrot OS, Raspberry Pi Black Edition! , ZX Spectrum 48k, C64, Enterprise 128K, The SID chip. Im Misunderstood!

blinkok

 Fascinating to follow this. Great work!

RemiD

#64
QuoteIm hoping Finally i may just get the idea on how to go about making my own Games

my advice to you is to not try to convert my code line by line, but rather one part a time, one functionality at a time.

so you start with a blank page / scene,
you add one kind of entity, you update them, you draw them, then you add more behaviors to these entities.
then you add another kind of entity, you update them, you draw them, then you add more behaviors to these entities.
etc...

for example, the different entities, for this game, are :
faraways (background)
spaceship
alien
ground
turret
pods
pexplosions
bombs
bexplosions
bullets
bimpacts
rockets
rexplosions
craters
particles
bloods

i suggest to implement one at a time.

and you use my code only as an example on how to implement it, but you code it your own way.

you will also need to learn how to debug, not only with text (for values, for states), but also visually, with dots (for 2d points), and with lines (for 2d outlines, for 2d vectors, for 2d normals), i have put these in comments you will see...

it is very similar in 3d, except i would use 3d cubes for 3d points, 3d stretched cubes for 3d lines, for 3d vectors, for 3d normals.

you can also display text on top of an entity to display its current action state or its current hitpoints, or inflicted damage, etc...

as i have said, there will be only the gameplay parts.
you will have to implement the title screen, intro screen, menu screen, score screen, credits screen, by yourself.

but i will provide a separate code example that i use for my games, which is quite 'basic' but works well for such simple games...

RemiD

#65
here is the last version : http://rd-stuff.fr/blitz3d/alien-dropout-2d-BB-20241210-2340.7z

controls :
arrowleft arrowright to move the turret left right
space to shoot bullets
alt to shoot a rocket

sound effects all done with my voice / mouth and some tweaks using 'wavepad'.

ambient music is a small part of a music of a famous game, tweaked a little bit, some of you may recognize it ? maybe... 8)

figure it out, have fun. ;D

RemiD

@Baggey >>
so, do you like the final game ? 

the graphics are not exactly the same, and the sound effects may sound a little weird, but this was my inspiration at the time ahah ;D

do you understand my bb code ?

if you need any help to understand some parts of the code, dont' hesitate to ask here...

Baggey

Hi @RemiD

The game is great! I have a big project on the go at the moment working on mimaSID and the C64 Emulator. The sound is almost perfect!

I thankyou for the .bb version of Alien Dropout and in the near future will have a go at a BlitzmaxNG version!

If i have any misunderstandings i will ask you ;)

Kind Regards Baggey
Running a PC that just Aint fast enough!? i7 4Ghz Quad core 32GB ram  2x1TB SSD and NVIDIA Quadro K1200 on 2 x HP Z24's . DID Technology stop! Or have we been assimulated!

Windows10, Parrot OS, Raspberry Pi Black Edition! , ZX Spectrum 48k, C64, Enterprise 128K, The SID chip. Im Misunderstood!

RemiD

Quotein the near future will have a go at a BlitzmaxNG version
curious to see what you will manage to make.

the good thing is that there are still some users of blitzmax on syntaxbomb, so you will manage to get some help when needed.

Baggey

@RemiD Here's my efforts so far

You'll need these :-

DropoutLOGO.png


And Runable BlitzmaxNG code


' Alien Dropout inspired by REMID's bb conversion!
'
' Re-Written into .bmx By Baggey
'
' Hopefully someone can learn from this?

SuperStrict

AppTitle = " Alien Dropout"

Graphics 544,416

' Load Graphics
Rem
Global TitleScreen:TPixmap = LoadPixmap("graphics\main.png")
         If TitleScreen = Null Then
           RuntimeError ("Error Loading graphics\main.png")
         End If

Global mainScreen:TPixmap = LoadPixmap("graphics\screen.png")
         If mainScreen = Null Then
           RuntimeError ("Error Loading graphics\screen.png")
         End If

Global Font:TPixmap = LoadPixmap("graphics\font.png")
         If Font = Null Then
           RuntimeError ("Error Loading graphics\font.png")
         End If

Global FontINVERSE:TPixmap = LoadPixmap("graphics\FontINVERSE.png")
         If FontINVERSE = Null Then
           RuntimeError ("Error Loading graphics\FontINVERSE.png")
         End If
End Rem

Global dropoutLOGO:TPixmap = LoadPixmap("graphics\dropoutLOGO.png")
         If dropoutLOGO = Null Then
           RuntimeError ("Error Loading graphics\dropoutLOGO.png")
         End If

Global LogoX:Int=148, LogoY:Int=-100, jump:Float=100

Global tickytocky:Int = 640

Global TextyString:String = "Inspired by [member=385]RemiD[/member] to finally have a go at writtng a game! Programed in BlitzMaxNG by Baggey 2024. "
TextyString:+"Game development is fun. So useing Remid's .bb version for inspiration.  Ive finally had a go myself! "
TextyString:+"    ZX81  Alien-Dropout        REMAKE of a REMAKE!??        Press S to Start! .... "

SetClsColor(0, 0, 0)
Cls

RunGame()

End

Function RunGame()

 Repeat

 Cls()

 If AppTerminate() Or KeyHit(Key_ESCAPE) Then End


 'DrawPixmap(TitleScreen,0,0)
 'DrawPixmap(mainScreen,0,0)
 'DrawPixmap(Font,16,0)
 'DrawPixmap(FontINVERSE,16,32)
 

 BounceLOGO()

 DrawText (TextyString,tickytocky,400)
    tickytocky:-2

    If tickytocky<-TextWidth(TextyString) Then
         tickytocky=640 ; LogoX=148 ; LogoY=-100 ; jump=100
    End If

 Flip(1)

 Forever

End Function


Function BounceLOGO()

 LogoY = jump * Sin(MilliSecs())

 DrawPixmap(dropoutLOGO, logoX, LogoY+20)

 If LogoY > 0 Then jump:-(1.25)
 
 
End Function
Running a PC that just Aint fast enough!? i7 4Ghz Quad core 32GB ram  2x1TB SSD and NVIDIA Quadro K1200 on 2 x HP Z24's . DID Technology stop! Or have we been assimulated!

Windows10, Parrot OS, Raspberry Pi Black Edition! , ZX Spectrum 48k, C64, Enterprise 128K, The SID chip. Im Misunderstood!

Baggey

#70
@RemiD

So here's the end of today's efforts. You'll need a folder called sounds and graphics and put these init.

sounds.zip  graphics.zip


' Alien Dropout inspired by REMID's bb conversion!
'
' Re-Written into .bmx By Baggey
'
' Hopefully someone can learn from this?

SuperStrict

AppTitle = " Alien Dropout"

Graphics 544,416

' Load Sounds

Global FadeTOgrey:TSound = LoadSound("sounds\fadetogrey.wav")


' Load Graphics

Global TitleScreen:TPixmap = LoadPixmap("graphics\main.png")
         If TitleScreen = Null Then
           RuntimeError ("Error Loading graphics\main.png")
         End If

Global mainScreen:TPixmap = LoadPixmap("graphics\screen.png")
         If mainScreen = Null Then
           RuntimeError ("Error Loading graphics\screen.png")
         End If

Global Font:TImage = LoadImage("graphics\font.png")
         If Font = Null Then
           RuntimeError ("Error Loading graphics\font.png")
         End If

Global FontINVERSE:TImage = LoadImage("graphics\FontINVERSE.png")
         If FontINVERSE = Null Then
           RuntimeError ("Error Loading graphics\FontINVERSE.png")
         End If

Global dropoutLOGO:TPixmap = LoadPixmap("graphics\dropoutLOGO.png")
         If dropoutLOGO = Null Then
           RuntimeError ("Error Loading graphics\dropoutLOGO.png")
         End If

' Load Fonts into arrays
Global ASCII:TPixmap[128]


Global Count:Byte

Global RunMODE:Byte=0

Global LogoX:Int=148, LogoY:Int=-100, jump:Float=100

Global tickytocky:Int = 640

Global TextyString:String = "Inspired by [member=385]RemiD[/member] to finally have a go at writtng a game! Programed in BlitzMaxNG by Baggey December 2024. "
TextyString:+"Game development is FUN. So using Remid's .bb version for inspiration.  I finally had a go myself! "
TextyString:+"    ZX81 Alien-Dropout       Currently a REMAKE of a REMAKE  LIKE!??          So Press S to Start! .... "


CreateUDGs()

SetClsColor(0, 0, 0)
Cls

RunGame()

End

Function CreateUDGs()

  For Local TileImages:Int = 0 To 63

      CopyImage(Font,TileImages,0)

Next

For Local TileImages:Int = 0 To 63

      CopyImage(FontINVERSE,TileImages,64)

Next

End Function

Function CopyImage(Font:TImage,Tile:Int,Index:Int)

  Local SourceFont:TPixmap = LockImage(Font)
  Local TileFont:TPixmap = CreatePixmap(16,16,PF_RGBA8888)

  Local CoordX:Int=(Tile * 16) Mod 512
  Local CoordY:Int=(Tile / 32) * 16

  TileFont = SourceFont.window( CoordX, CoordY,16 ,16 )
 
  UnlockImage (Font)

  ASCII[Tile+index]=TileFont

End Function


Function RunGame()

 Repeat

 Cls()

 If AppTerminate() Or KeyHit(Key_ESCAPE) Then End


 'DrawPixmap(TitleScreen,0,0)
 'DrawPixmap(mainScreen,0,0)
 'DrawPixmap(Font,16,0)
 'DrawPixmap(FontINVERSE,16,32)
 

 If RunMODE=0 Then BounceLOGO()

 If RunMODE=1 Then FadeSCREEN()

 If RunMODE=2 Then DisplayTitleSCREEN()

 'Flip(1)

 Forever

End Function


Function DisplayTitleScreen()

  DrawPixmap(TitleScreen,0,0)

  'If Count=>127 Then count=0
  'PrintAT(0,Count,Count)
  'Count:+3

  Flip(1)

End Function


Function PrintAT(X:Int, Y:Int, Char:Byte)


  DrawPixmap( ASCII[Char], (X+16), (Y+16) )


End Function


Function FadeSCREEN()

    Local R:Int, G:Int, B:Int

    PlaySound fadeTOgrey

    For Local fade:Int = 0 To 190 Step 0.9

       SetClsColor(R+fade, G+fade, B+fade)
       Cls()
   
       Flip(1)

       fade:+1

    Next

    RunMODE=2


End Function


Function BounceLOGO()

 LogoY = jump * Sin(MilliSecs())

 DrawPixmap(dropoutLOGO, logoX, LogoY+20)

 If LogoY > 0 Then jump:-(1.25)

 ScrollText()
 
 Flip(1)

End Function


Function ScrollText()

  DrawText (TextyString,tickytocky,396)
    tickytocky:-1

    If tickytocky<-TextWidth(TextyString) Then
         tickytocky=640 ; LogoX=148 ; LogoY=-100 ; jump=100
    End If

    If KeyHit(Key_S) Then RunMODE=1

End Function

I hope you like it so far! Your the inspirater to get me to finally have ago! ;)

Baggey
Running a PC that just Aint fast enough!? i7 4Ghz Quad core 32GB ram  2x1TB SSD and NVIDIA Quadro K1200 on 2 x HP Z24's . DID Technology stop! Or have we been assimulated!

Windows10, Parrot OS, Raspberry Pi Black Edition! , ZX Spectrum 48k, C64, Enterprise 128K, The SID chip. Im Misunderstood!

RemiD

@Baggey >>
yes it is a good idea that you post your progress on this worklog, i will follow that.

can you tell me which version of BlitzmaxNG you use ? and if you use some external libs ? so that i will not encounter weird errors when running your code...
thanks,

Baggey

#72
Pas de probleme mon ami, je utilise  NG version.PNG

Sorry! No problems i use -------------^

I have no idea of
Quoteexternal libs
This is straight out off the box! I right my own code no engines needed :-X
Running a PC that just Aint fast enough!? i7 4Ghz Quad core 32GB ram  2x1TB SSD and NVIDIA Quadro K1200 on 2 x HP Z24's . DID Technology stop! Or have we been assimulated!

Windows10, Parrot OS, Raspberry Pi Black Edition! , ZX Spectrum 48k, C64, Enterprise 128K, The SID chip. Im Misunderstood!

RemiD

#73
ok !

( je comprends le français, c'est ma langue d'origine ;) )

but why are there so many releases of BlitzmaxNG ?  ???

this is so confusing...

Baggey

The Worklog is here showing progress. And if i need help to do with BlitzmaxNG it's over there!? ::)

Kind Regards Baggey
Running a PC that just Aint fast enough!? i7 4Ghz Quad core 32GB ram  2x1TB SSD and NVIDIA Quadro K1200 on 2 x HP Z24's . DID Technology stop! Or have we been assimulated!

Windows10, Parrot OS, Raspberry Pi Black Edition! , ZX Spectrum 48k, C64, Enterprise 128K, The SID chip. Im Misunderstood!