Thanks for the feedback - still working on it and
will post soon
will post soon
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.
Show posts MenuQuote from: spacefractal on 2023-Dec-28Happy Xmas.
etc im today finally got my Spectrum Next issue 2 machine. Currectly working a that remake named "Head Over Heels" to that as one of the strect issue 2 kickstarter. Im guess all/most speccy games know that game. hihi.
// Set the screen dimensions
SCREEN 800, 600, 0, 2
// Define menu constants
CONST MENU_ITEM_HEIGHT = 50
CONST MENU_TEXT_SIZE = 20
// Define menu items
GLOBAL menuItems[2] = ["Option 1", "Option 2"]
GLOBAL selectedMenuItem = -1
// Main loop
WHILE TRUE
// Clear the screen
CLS RGB(255, 255, 255)
// Draw menu items
FOR i = 0 TO UBOUND(menuItems)
LOCAL itemY = i * MENU_ITEM_HEIGHT + 10
RECT 10, itemY, 790, itemY + MENU_ITEM_HEIGHT, RGB(200, 200, 200)
PRINT menuItems[i], 20, itemY + 10, MENU_TEXT_SIZE
NEXT
// Check for mouse input
LOCAL mouseX, mouseY, mouseButton
MOUSESTATE mouseX, mouseY, mouseButton
// Highlight the selected menu item
selectedMenuItem = -1
FOR i = 0 TO UBOUND(menuItems)
LOCAL itemY = i * MENU_ITEM_HEIGHT + 10
IF mouseX > 10 AND mouseX < 790 AND mouseY > itemY AND mouseY < itemY + MENU_ITEM_HEIGHT
RECT 10, itemY, 790, itemY + MENU_ITEM_HEIGHT, RGB(150, 150, 150)
selectedMenuItem = i
ENDIF
NEXT
// Check for mouse click on a menu item
IF mouseButton = 1 AND selectedMenuItem <> -1
// Perform action based on the selected menu item
SELECT selectedMenuItem
CASE 0
PRINT "Option 1 selected", 400, 300
CASE 1
PRINT "Option 2 selected", 400, 300
END SELECT
SLEEP 1000 // Display the message for a short time
ENDIF
// Refresh the screen
SHOWSCREEN
WEND
// End the program
END
SUB main2:
LOADFONz("bigscore.png",1)
SETFONT 1
// Set the screen dimensions
//SCREEN 800, 600, 0, 2
// Define menu constants
CONSTANT MENU_ITEM_HEIGHT = 50
CONSTANT MENU_TEXT_SIZE = 20
// Define menu items
GLOBAL menuItems$[]
DIM menuItems$[2]
menuItems$[0]="Option 1"
menuItems$[1]="Option 2"
GLOBAL selectedMenuItem = -1
// Main loop
WHILE TRUE
// Clear the screen
CLEARSCREEN RGB(255, 255, 255)
// Draw menu items
FOR i = 0 TO LEN(menuItems$[])-1
LOCAL itemY = i * MENU_ITEM_HEIGHT + 10
DRAWRECT 10, itemY, 790, itemY + MENU_ITEM_HEIGHT, RGB(200, 200, 200)
PRINT menuItems$[i], 20, itemY + 10, MENU_TEXT_SIZE
NEXT
// Check for mouse input
LOCAL mouseX, mouseY, mouseButton,mb2
MOUSESTATE mouseX, mouseY, mouseButton,mb2
// Highlight the selected menu item
selectedMenuItem = -1
FOR i = 0 TO LEN(menuItems$[])-1
LOCAL itemY = i * MENU_ITEM_HEIGHT + 10
IF mouseX > 10 AND mouseX < 790 AND mouseY > itemY AND mouseY < itemY + MENU_ITEM_HEIGHT
DRAWRECT 10, itemY, 790, itemY + MENU_ITEM_HEIGHT, RGB(150, 150, 150)
selectedMenuItem = i
ENDIF
NEXT
// Check for mouse click on a menu item
IF mouseButton = 1 AND selectedMenuItem <> -1
// Perform action based on the selected menu item
SELECT selectedMenuItem
CASE 0
PRINT "Option 1 selected", 400, 300
CASE 1
PRINT "Option 2 selected", 400, 300
ENDSELECT
SLEEP 1000 // Display the message for a short time
ENDIF
// Refresh the screen
SHOWSCREEN
WEND
// End the program
ENDSUB
Quote from: Qedo on 2023-Sep-05tried it and it's very nice big, the only problem but maybe it's my problem is the management of the direction keys
Perhaps they are too far away and often have to look at the position of my finger in relation to theirs.I don't know.
I will continue to play it to practice. Well done