03-31-2024, 09:21 PM (This post was last modified: 03-31-2024, 09:34 PM by madscijr.)
(03-30-2024, 11:16 PM)Petr Wrote: To the question above - motion of the stars - here is the solution in the form of a hardware image - it shows how to get the motion into the hardware image.
I was able to modify your code to scroll the background vertically in pseudo 3d, and overlay the foreground over it.
The only problem is everything displays too low on the screen - how would you make it top aligned?
Code: (Select All)
Dim Image As Long
Dim ifg&
Dim ibg&
Dim xs As Long
Dim ys As Long
Dim h1 As Long
Dim w1 As Long
'newhandle& = _COPYIMAGE(imageHandle&[, mode%])
'Mode 33 images are hardware accelerated in version 1.000 and up, and are created using _LOADIMAGE or _COPYIMAGE.
ibg& = _CopyImage(Virtual, 33)
04-01-2024, 03:57 PM (This post was last modified: 04-01-2024, 03:58 PM by TerryRitchie.)
Here's a little proof of concept. You'll need the si3.png image I included below. I had to resize it to 960x960 and convert to 32bit color.
Play around with the x,y coordinates in the secondary x,y,z coordinates of _MAPTRIANGLE to fit the image.
Code: (Select All)
DIM si3 AS LONG ' space invaders image
DIM bg2 AS LONG ' background image
DIM by AS INTEGER ' background y
DIM GameScreen AS LONG ' software screen to update
DIM HWScreen AS LONG ' hardware screen to display
04-01-2024, 07:28 PM (This post was last modified: 04-01-2024, 09:13 PM by madscijr.)
(04-01-2024, 03:57 PM)TerryRitchie Wrote: Here's a little proof of concept. You'll need the si3.png image I included below. I had to resize it to 960x960 and convert to 32bit color.
Play around with the x,y coordinates in the secondary x,y,z coordinates of _MAPTRIANGLE to fit the image.
Thanks... I tried playing around with the x,y coordinates in the secondary x,y,z of _MAPTRIANGLE but it seems that whatever I try, it just mangles the screen.
I'm at my wits end with that part of things...
Here's the latest code along with the latest images (tweaked the background image so it wraps around smoothly, and changed scrolling direction to down).
Dim fg As Long ' foreground image (sprites, text)
Dim bg As Long ' background image (for scrolling)
Dim by As Integer ' background y
Dim GameScreen As Long ' software screen to update
Dim HWScreen As Long ' hardware screen to display
'newhandle& = _COPYIMAGE(imageHandle&[, mode%])
'Mode 33 images are hardware accelerated in version 1.000 and up, and are created using _LOADIMAGE or _COPYIMAGE.
HWScreen = _CopyImage(GameScreen, 33)
'>>The only problem is everything displays too low on the screen - how would you make it top aligned?
'>Play around with the x,y coordinates in the secondary x,y,z coordinates of _MAPTRIANGLE to fit the image.
'Not working, any ideas?:
_MapTriangle (0, 0)-(0, 959)-(959, 959), HWScreen To(-1, 1, -3)-(-1, -1, -1)-(1, -1, -1), 0
_MapTriangle (0, 0)-(959, 959)-(959, 0), HWScreen To(-1, 1, -3)-(1, -1, -1)-(1, 1, -3), 0
_Display
by = by + 1: If by = 0 Then by = -2000 ' SCROLL FORWARDS