Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - TrialAndTerror

Pages: [1]
1
Programs / Re: Helicopter game from previous forum
« on: August 12, 2021, 08:57:58 pm »
Hi. Latest version. It's still eating stack, must be the GOTO and GOSUB spaghetti. I give up. :(
A few changes though, ver2.23.

Greets, T&T

2
Programs / Re: Drum Machine Prototype
« on: April 14, 2020, 10:27:14 pm »
Great program! Thank you Dav. It helps me out when recording some musical ideas.
Very inspiring.

I haven't looked into the code but I have a question:
Can you make it run 3/4 too?
It's an essential feature for a drum machine.

T&T

3
Programs / Re: Simple Piano
« on: April 01, 2020, 10:06:55 pm »
Love it!

One thing: Why doesn't it accept the Csus chord? (On the computer keyboard "d"+"h"+"j")
This piece of code is useful to me, thanks Terry. :)

T&T

4
Programs / Re: Convert pictures to 256-colour embedded sprites
« on: October 29, 2019, 10:08:24 pm »
I'm new to GitHub but I'll surely have a look at it, SMcNeill, thanks!
I'm specially interested in the 'embedding' part of it, also looking for
a way to embed .WAV or .OGG data in a program.

Is this the good place to ask simple questions BTW?

T&T

5
Programs / Convert pictures to 256-colour embedded sprites
« on: October 29, 2019, 08:51:26 pm »
Hi, here's a piece of code I use to embed sprites in a program when I don'r want to use original PNG, JPG or BMP files.
I'm sure there's a better way to embed graphics. Anyone?

T&T

P.S. it outputs "Data.bas" containing sprite and colour data.

Code: QB64: [Select]
  1. DEFINT A-Z
  2.  
  3. SCREEN _NEWIMAGE(640, 480, 32)
  4.  
  5. LOCATE 10, 18: INPUT "Afbeelding plus extensie (JPG,BMP,PNG) "; I$
  6.  
  7. IF _FILEEXISTS(I$) = 0 THEN LOCATE 22, 1: PRINT "Bestandsfout. Druk een toets...": SLEEP: SYSTEM
  8.  
  9. Stam$ = LEFT$(I$, LEN(I$) - 4)
  10.  
  11.  
  12. Afbeelding& = _LOADIMAGE(I$)
  13.  
  14. Breedte = _WIDTH(Afbeelding&)
  15. Hoogte = _HEIGHT(Afbeelding&)
  16.  
  17. Volgorde$ = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@"
  18.  
  19. IF Breedte < 1 OR Hoogte < 1 OR Breedte > 320 OR Hoogte > 320 THEN LOCATE 22, 1: PRINT "Foute afmetingen. Druk een toets...": SLEEP: SYSTEM
  20.  
  21. DIM ch(0 TO 63 + 256 * 63 + 65536 * 63)
  22. DIM w&(1 TO Breedte * Hoogte)
  23. DIM v&(1 TO Breedte * Hoogte)
  24. DIM p&(32 TO Breedte * Hoogte)
  25. DIM b$(1 TO LEN(Volgorde$))
  26. DIM Kleur(0 TO Breedte - 1, 0 TO Hoogte - 1)
  27.  
  28. FOR p = 1 TO LEN(Volgorde$)
  29.     b$(p) = MID$(Volgorde$, p, 1)
  30.  
  31. LINE (320, 0)-(320, 320)
  32. LINE (0, 320)-(320, 320)
  33.  
  34. _PUTIMAGE (0, 0), Afbeelding&
  35.  
  36. FOR y = 0 TO Hoogte - 1
  37.     FOR x = 0 TO Breedte - 1
  38.         t = t + 1
  39.         w&(t) = POINT(x, y)
  40.         v&(t) = (_RED32(w&(t)) \ 4) + 256 * (_GREEN32(w&(t)) \ 4) + 65536 * (_BLUE32(w&(t)) \ 4)
  41.     NEXT
  42.  
  43. FOR j = 1 TO t
  44.     Uniek = 1
  45.     FOR m = 1 TO j - 1
  46.         IF v&(j) = v&(m) THEN Uniek = 0
  47.     NEXT
  48.     IF Uniek = 1 THEN
  49.         AantalKleuren = AantalKleuren + 1
  50.         p&(AantalKleuren + 31) = v&(j)
  51.     END IF
  52.  
  53. LOCATE 22, 1: PRINT "Aantal gedetecteerde Kleuren:"; AantalKleuren
  54.  
  55. IF AantalKleuren > LEN(Volgorde$) THEN: LOCATE 22, 1: PRINT "Sorry, maximaal"; LEN(Volgorde$); " verschillende Kleuren per afbeelding. Druk een toets...": SLEEP: SYSTEM
  56.  
  57. SCREEN _NEWIMAGE(640, 480, 256)
  58.  
  59. LINE (320, 0)-(320, 320)
  60. LINE (0, 320)-(320, 320)
  61.  
  62. OPEN Stam$ + "Data.bas" FOR OUTPUT AS #1
  63.  
  64. PRINT #1, "DATA " + LTRIM$(STR$(AantalKleuren))
  65. PRINT #1, "DATA " + LEFT$(Volgorde$, AantalKleuren)
  66.  
  67. WHILE k < AantalKleuren
  68.     k = k + 1
  69.     t$ = t$ + LTRIM$(RTRIM$(STR$(p&(k + 31))))
  70.     t$ = t$ + ","
  71. t$ = LEFT$(t$, LEN(t$) - 1)
  72. t$ = "DATA " + t$
  73. PRINT #1, t$
  74.  
  75. FOR Kleurkanaal = 32 TO 32 + AantalKleuren - 1
  76.     PALETTE Kleurkanaal, p&(Kleurkanaal)
  77.     ch(p&(Kleurkanaal)) = Kleurkanaal
  78.  
  79. FOR y = 0 TO Hoogte - 1
  80.     FOR x = 0 TO Breedte - 1
  81.         Teller = Teller + 1
  82.         Kleur(x, y) = ch(v&(Teller))
  83.         PSET (x, y), Kleur(x, y)
  84.     NEXT
  85.  
  86. FOR y = 0 TO Hoogte - 1
  87.     a$ = "DATA "
  88.     FOR x = 0 TO Breedte - 1
  89.         a$ = a$ + b$(POINT(x, y) - 31)
  90.     NEXT
  91.     PRINT #1, a$
  92. PRINT #1, "DATA $$$"
  93.  
  94.  
  95. LOCATE 22, 1: PRINT Stam$ + "Data.bas weggeschreven."
  96. LOCATE 24, 1: PRINT "Druk een toets om af te sluiten.";: SLEEP: SYSTEM
  97.  


6
Programs / Re: Helicopter game from previous forum
« on: February 10, 2019, 09:02:37 pm »
This is a VERY cool game. I think I have seen this before. I don't think I survived for very long then either... I must see if I can get the joystick out of storage and try again tomorrow after I have had a good night's sleep and a morning coffee.

Well done!

Thank you!

Mentioning the joystick: I connected mine after a year or so and I noticed the throttle doesn't function properly. Could be in the software or in the hardware. I will look into it. (Or maybe buy a controller)
Note that it is intended to be a mouse game, joystick support is an extra and you cannot replay your flight when using a joystick.

T&T


7
Programs / Re: Helicopter game from previous forum
« on: February 10, 2019, 01:04:50 am »
I haven't started playing with it yet, but I can already tell it's great.   Better than sliced cheese.
Reminds me of PLATO's 0airfight.   Carry on, Master of the Green Screen.

Thank you. I checked out Airfight, looks familiar indeed. It has the correct math, Helicopter Rescue doesn't, I'm afraid...
My programs are always WIP: I'll try to improve the gameplay too, for example: more then one airfield to create somewhat of a storyline.
Also planning on different routes for the enemy vehicles instead of having them all heading for the base.

T&T

8
Programs / Re: Tetris
« on: September 24, 2018, 07:12:36 pm »
Beautiful. The preset speed is a little to high for me though.
T&T

9
Programs / Re: Helicopter game from previous forum
« on: September 22, 2018, 06:57:06 pm »
Welcome! TrialAndTerror, LOL  I could have swore you used to go by TrialAndError.

I am aware of my shortcomings Terry, that's why I chose this name. I also prefer improvised music, LOL.

10
Programs / Re: Helicopter game from previous forum
« on: September 22, 2018, 06:07:01 pm »
Oops, There is some serious trouble with the program flow -what was I thinking?-, with as result Menu.exe eating memory. No problem, just don't let it run for hours. I will try to fix that.
Greets, T&T

11
Programs / Helicopter game from previous forum
« on: August 02, 2018, 02:06:46 am »
Hi there. Here's the latest version of Helicopter Rescue, code included in .zip.
T&T

Pages: [1]