Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ONE PROMPT AI DEV
#1
So i got the following from a single prompt...use A and D to move the paddle.

Code: (Select All)
' PRO BREAKOUT CLONE - QB64 GL EDITION
_TITLE "NEON BREAKOUT ULTRA"
SCREEN _NEWIMAGE(800, 600, 32)
RANDOMIZE TIMER

' Constants and Types
TYPE GameObject
  x AS SINGLE
  y AS SINGLE
  w AS SINGLE
  h AS SINGLE
  dx AS SINGLE
  dy AS SINGLE
  hp AS INTEGER
  c AS _UNSIGNED LONG
END TYPE

' Game State Variables
DIM SHARED p AS GameObject, b AS GameObject
DIM SHARED brick(1 TO 10, 1 TO 8) AS GameObject
DIM SHARED score&, lives%, level%, gameState%, ballActive%
DIM SHARED brickCount%, baseSpeed AS SINGLE

' Initialize Game
level% = 1: lives% = 3: score& = 0: baseSpeed = 4
InitLevel

' Main Game Loop
DO
  _LIMIT 60
  CLS

  SELECT CASE gameState%
    CASE 0: DrawMenu
    CASE 1: PlayGame
    CASE 2: GameOver
  END SELECT

  _DISPLAY
LOOP

SUB InitLevel
  ' Reset Paddle
  p.w = 100: p.h = 15: p.x = 400 - p.w / 2: p.y = 550
  ' Reset Ball
  ResetBall
  ' Build Bricks
  brickCount% = 0
  FOR row = 1 TO 8
    FOR col = 1 TO 10
      brick(col, row).w = 70
      brick(col, row).h = 25
      brick(col, row).x = 15 + (col - 1) * 78
      brick(col, row).y = 50 + (row - 1) * 30
      ' Difficulty: Bricks get more HP every 2 levels
      brick(col, row).hp = 1 + INT(level% / 3)
      brick(col, row).c = _RGB32(row * 30, 255 - (row * 20), 200 + col * 5)
      brickCount% = brickCount% + 1
    NEXT
  NEXT
END SUB

SUB ResetBall
  ballActive% = 0
  b.w = 12: b.h = 12
  b.x = p.x + p.w / 2 - 6
  b.y = p.y - 15
  ' Ball speed increases with level
  b.dx = (baseSpeed + level%) * .7
  b.dy = -(baseSpeed + level%)
END SUB

SUB PlayGame
  ' Movement Input (A and D)
  IF _KEYDOWN(97) OR _KEYDOWN(65) THEN p.x = p.x - 8 ' A
  IF _KEYDOWN(100) OR _KEYDOWN(68) THEN p.x = p.x + 8 ' D
  IF p.x < 0 THEN p.x = 0
  IF p.x > 800 - p.w THEN p.x = 800 - p.w

  ' Space to start ball
  IF ballActive% = 0 THEN
    b.x = p.x + p.w / 2 - 6
    COLOR _RGB32(255, 255, 255)
    _PRINTSTRING (300, 400), "PRESS [SPACE] TO LAUNCH BALL"
    IF _KEYDOWN(32) THEN ballActive% = 1
  ELSE
    ' Physics
    b.x = b.x + b.dx
    b.y = b.y + b.dy

    ' Wall Bounce
    IF b.x < 0 OR b.x > 788 THEN b.dx = -b.dx
    IF b.y < 0 THEN b.dy = -b.dy

    ' Paddle Bounce
    IF b.y + b.h > p.y AND b.x + b.w > p.x AND b.x < p.x + p.w THEN
      b.dy = -ABS(b.dy)
      ' Dynamic bounce based on where it hits paddle
      b.dx = (b.x - (p.x + p.w / 2)) / 5
    END IF

    ' Brick Collision
    FOR r = 1 TO 8
      FOR c = 1 TO 10
        IF brick(c, r).hp > 0 THEN
                    IF b.x + b.w > brick(c, r).x AND b.x < brick(c, r).x + brick(c, r).w AND _
                      b.y + b.h > brick(c, r).y AND b.y < brick(c, r).y + brick(c, r).h THEN
            b.dy = -b.dy
            brick(c, r).hp = brick(c, r).hp - 1
            score& = score& + 10
            IF brick(c, r).hp = 0 THEN brickCount% = brickCount% - 1
          END IF
        END IF
      NEXT
    NEXT

    ' Death
    IF b.y > 600 THEN
      lives% = lives% - 1
      IF lives% <= 0 THEN gameState% = 2 ELSE ResetBall
    END IF

    ' Level Win
    IF brickCount% <= 0 THEN
      level% = level% + 1
      InitLevel
    END IF
  END IF

  ' Rendering (Flamboyant Glow Effect)
  LINE (p.x, p.y)-(p.x + p.w, p.y + p.h), _RGB32(0, 255, 255), BF
  CIRCLE (b.x + 6, b.y + 6), 8, _RGB32(255, 255, 0)
  PAINT (b.x + 6, b.y + 6), _RGB32(255, 100, 0), _RGB32(255, 255, 0)

  FOR r = 1 TO 8
    FOR c = 1 TO 10
      IF brick(c, r).hp > 0 THEN
        LINE (brick(c, r).x, brick(c, r).y)-(brick(c, r).x + 68, brick(c, r).y + 23), brick(c, r).c, BF
        ' HP Indicator
        _PRINTSTRING (brick(c, r).x + 30, brick(c, r).y + 5), LTRIM$(STR$(brick(c, r).hp))
      END IF
    NEXT
  NEXT

  COLOR _RGB32(255, 255, 255)
  _PRINTSTRING (10, 10), "SCORE:" + STR$(score&) + "  LIVES:" + STR$(lives%) + "  LEVEL:" + STR$(level%)
END SUB

SUB DrawMenu
  COLOR _RGB32(255, 200, 0)
  _PRINTSTRING (330, 250), "NEON BREAKOUT ULTRA"
  COLOR _RGB32(255, 255, 255)
  _PRINTSTRING (320, 300), "PRESS [S] TO START GAME"
  _PRINTSTRING (320, 330), "PRESS [Q] TO QUIT"
  IF UCASE$(INKEY$) = "S" THEN gameState% = 1
  IF UCASE$(INKEY$) = "Q" THEN SYSTEM
END SUB

SUB GameOver
  COLOR _RGB32(255, 0, 0)
  _PRINTSTRING (350, 250), "GAME OVER!"
  _PRINTSTRING (320, 280), "FINAL SCORE:" + STR$(score&)
  _PRINTSTRING (310, 320), "PRESS [R] TO RESTART"
  IF UCASE$(INKEY$) = "R" THEN
    level% = 1: lives% = 3: score& = 0: InitLevel: gameState% = 1
  END IF
END SUB

And as such i ask, with only a single prompt what can you guys get Googles Ai to make?

Unseen
Reply
#2
Wow, that's actually impressive! The physics are already quite good. Imagine what it could be if it was to be expanded upon!


[Image: sds.png]
Reply
#3
Works and plays well.  Surprising you got such good QB64 code output. Great start to build on.  The times Ive ask AI for QB64 help i spend most of the time teaching it proper syntax.  Im just using the free AI sites though, not the ones you have to register or use keys.  

- Dav

Find my programs here in Dav's QB64 Corner
Reply
#4
Well if the damn thing can't make me a sandwich, what good is it?

Pete

- I support the Navy building more subs... especially pastrami!
Reply
#5
Well im not sure that sandwiches are actually included in LLMs! Sorry Pete!

And yes, it works well and could be easily built upon. I simply used Google in AI  mode to do it, no special models or anything...it used to give me a lot of errors but lately it's got a lot better at creating working code first shot. I asked it if 5 people asked the same question to generate code would they all get the same result  and it said NO which was a most surprising revelation to me!

Give it a go, just ask Google, QB64 code, etc...and see what it gives ya...just remember to tell it the rules, inputs etc and then i have found that telling it to be flamboyant or to show off gives me much better results.

Unseen
Reply
#6
I asked AI to improve Windows 11, but it said my recycle bin wasn't big enough.

My biggest fear is "Clippy" will be back with a vengeance. "It looks like you're trying to write a resume for a job. Let me help!" As the sound of a paper shredder is heard over the speakers and the screen turns black as the computer suddenly powers off.

It's ironic to think that the folks who code as a profession would code the very thing that will put them out of a job. Sure, for now folks will say its just a tool, and aid, but if it keeps progressing, it will become the programmer.

Pete
Reply
#7
(12-30-2025, 09:08 PM)Pete Wrote: Well if the damn thing can't make me a sandwich, what good is it?

Pete

- I support the Navy building more subs... especially pastrami!

Well... The damn thing made a Pete sandwich in one try!!

Code: (Select All)
' ASCII Sandwich with PETE integrated
' QB64-PE compatible

Screen 0
Color 7, 0
Cls

Color 14
Print "ASCII SANDWICH OF PETE"
Print String$(26, "-")
Print

' Top bun
Color 6
Print "          __________________          "
Print "      .-'" + String$(18, "_") + "'-.      "
Print "    .'                      '.    "
Print "    /                            \  "

' Lettuce layer with PETE woven in
Color 10
Print "  /  ~~~  P E T E  ~~~  ~~~    \  "
Print "  /  ~~~~~  P E T E  ~~~~~  ~~~~    \ "

' Tomato layer with PETE stamped
Color 12
Print " |  ()  ()  PETE  ()  ()      | "

' Cheese layer with PETE cutouts
Color 14
Print " |  \\\\PETE\\\\  \\\\PETE\\\\    | "

' Meat layer branded with PETE
Color 4
Print " | ###PETE### ###PETE### ###PETE### | "

' Sauce layer dripping PETE
Color 13
Print " |  :TongueETE::  :TongueETE::  :TongueETE::  | "

' Bottom bun
Color 6
Print "  \                                / "
Print "  \______________________________/  "

Color 7
Print
Print "Press any key to exit..."
Sleep
End
Reply
#8
Quote:I asked AI to improve Windows 11

I asked AI to improve Windows 11 for Pete, this is what I got:
Code: (Select All)
Screen _NewImage(600, 600, 32)
_Title "Windows 11 Pete Edition"

' Official Windows 11 Blue Shades
Dim p1 As Long: p1 = _RGB32(0, 120, 215) ' Top Left
Dim p2 As Long: p2 = _RGB32(0, 103, 192) ' Top Right
Dim p3 As Long: p3 = _RGB32(0, 90, 158) ' Bottom Left
Dim p4 As Long: p4 = _RGB32(0, 75, 140) ' Bottom Right

' --- Draw the 4 Blue Panes ---
Line (150, 150)-(245, 245), p1, BF ' Pane 1
Line (255, 150)-(350, 245), p2, BF ' Pane 2
Line (150, 255)-(245, 350), p3, BF ' Pane 3
Line (255, 255)-(350, 350), p4, BF ' Pane 4

' --- Insert "PETE" ---
Color _RGB32(255, 255, 255) ' White text

_PrintMode _KeepBackground
Locate 13, 25: Print "P"
Locate 13, 38: Print "E"
Locate 20, 25: Print "T"
Locate 20, 38: Print "E"

Locate 26, 23: Print "Windows 11 Pete"
End
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply
#9
Serves you right for asking an obvious DEI AI hire. It's probably half Puerto Raytheon.

Pete Big Grin
Reply
#10
I came back to the AI Window and thanked it for the code and it offered up a more complete Pete OS.
OK lets see that!
Code: (Select All)
Screen _NewImage(800, 600, 32) ' Create a modern high-res screen
_Title "Pete OS v1.0 - Startup"

' --- PHASE 1: Boot Sequence ---
Color _RGB32(200, 200, 200) ' Retro gray text
Print "PeteBIOS (C) 2025 Pete Computing Inc."
_Delay .5
Print "CPU: Pete-Processor @ 4.20 GHz"
Print "RAM: 64 GB OK"
_Delay 1
Print "Detecting Drives..."
_Delay .5
Print "Drive 0: PETE-SSD-1TB [Ready]"
Print "Loading Pete OS..."
_Delay 1.5
Cls

' --- PHASE 2: Desktop Environment ---
' Draw a desktop background (Solid Blue-ish Teal)
Line (0, 0)-(799, 599), _RGB32(0, 128, 128), BF

' Draw a Taskbar at the bottom
Line (0, 560)-(799, 599), _RGB32(192, 192, 192), BF ' Gray taskbar
Line (0, 560)-(799, 560), _RGB32(255, 255, 255) ' Highlight top edge

' Draw the "Start" Button (The Pete Logo)
Dim pBlue As Long: pBlue = _RGB32(0, 100, 188)
Line (5, 565)-(35, 595), pBlue, BF
Color 0: Locate 36, 2: Print "Pete"

' --- PHASE 3: Floating Pete OS Logo (Windows 11 Style) ---
' Centering the logo we made earlier
x = 350: y = 200
Line (x, y)-(x + 45, y + 45), _RGB32(0, 120, 215), BF ' Top Left
Line (x + 50, y)-(x + 95, y + 45), _RGB32(0, 103, 192), BF ' Top Right
Line (x, y + 50)-(x + 45, y + 95), _RGB32(0, 90, 158), BF ' Bottom Left
Line (x + 50, y + 50)-(x + 95, y + 95), _RGB32(0, 75, 140), BF ' Bottom Right

' Add the "PETE" text into the panes
Color _RGB32(255, 255, 255)
_PrintMode _KeepBackground
Locate 15, 47: Print "P": Locate 15, 54: Print "E"
Locate 18, 47: Print "T": Locate 18, 54: Print "E"

Locate 22, 45: Print "Welcome to Pete OS"

' --- PHASE 4: Custom Mouse Cursor ---
' QB64 allows you to hide the system mouse and draw your own
_MouseHide
Do
    _Limit 60 ' Keep it at 60 FPS
    While _MouseInput: Wend ' Update mouse data

    ' Only redraw the mouse part (using _DISPLAY for no flicker)
    _Display
    mx = _MouseX: my = _MouseY

    ' Draw a simple retro mouse pointer (triangle)
    Line (mx, my)-(mx + 10, my + 10), _RGB32(255, 255, 255)
    Line (mx, my)-(mx, my + 15), _RGB32(255, 255, 255)
    Line (mx, my + 15)-(mx + 10, my + 10), _RGB32(255, 255, 255)
Loop Until _KeyDown(27) ' ESC to exit
System
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)