Space Invaders
Space Invaders
I've uploaded a space invaders type game to github. Happy to discuss with anyone interested.
Please forgive any style or other errors. I'm new to Freebasic (and Github) though not new to programming.
https://github.com/ixiz9/freebasic-game ... e-invaders
Please forgive any style or other errors. I'm new to Freebasic (and Github) though not new to programming.
https://github.com/ixiz9/freebasic-game ... e-invaders
Last edited by ixiz9 on Jan 04, 2023 18:23, edited 1 time in total.
Re: Space Invaders
Code: Select all
Aborting due to runtime error 7 (null pointer access) at line 411 of C:\Programming\other-projects\freebasic-games-main\space_invaders\assets.bas::MAKEBASES()
Re: Space Invaders
Thanks for trying it out.
I'd love to understand why this is not working for you.
Obviously, this is working for me, and I always run from the command line. I tried with the -exx flag but everything worked.
I am running on a chromebook on the built-in Linux. I see you are running on Windows, so that might be the problem. I will try on Windows.
Based on the line number you posted it is most likely that this line is failing for you and returning 0.
gaming.bas line 142:
dim as fb.Image Ptr img = ImageCreate(wid*xfactor, height*yfactor, RGB(255,0,255), 32)
where the values should resolve as
dim as fb.Image Ptr img = ImageCreate(24, 24, RGB(255,0,255), 32)
This line is likely returning 0. I could check for that and avoid the crash, but all I could do at that point is abort the program. I have no idea why that call would fail.
It did work for me on Windows 11 on a small Dell notebook. One odd thing I noticed was the that screen was much too big. It appears that on Windows 11 FB respects the "Scale" setting so the window ends up too large. I'll see if I can do something about that.
I'd love to understand why this is not working for you.
Obviously, this is working for me, and I always run from the command line. I tried with the -exx flag but everything worked.
I am running on a chromebook on the built-in Linux. I see you are running on Windows, so that might be the problem. I will try on Windows.
Based on the line number you posted it is most likely that this line is failing for you and returning 0.
gaming.bas line 142:
dim as fb.Image Ptr img = ImageCreate(wid*xfactor, height*yfactor, RGB(255,0,255), 32)
where the values should resolve as
dim as fb.Image Ptr img = ImageCreate(24, 24, RGB(255,0,255), 32)
This line is likely returning 0. I could check for that and avoid the crash, but all I could do at that point is abort the program. I have no idea why that call would fail.
It did work for me on Windows 11 on a small Dell notebook. One odd thing I noticed was the that screen was much too big. It appears that on Windows 11 FB respects the "Scale" setting so the window ends up too large. I'll see if I can do something about that.
Re: Space Invaders
Hi.
I have uploaded a new version to github that will hopefully address this problem.
I have tested it under both ChromeOS and Windows.
Please take a look. Thank you.
I have uploaded a new version to github that will hopefully address this problem.
I have tested it under both ChromeOS and Windows.
Please take a look. Thank you.
Re: Space Invaders
Sorry, due to some error on my part I had to move the repository to
https://github.com/ixiz9/freebasic-game ... e-invaders
https://github.com/ixiz9/freebasic-game ... e-invaders
Re: Space Invaders
Code: Select all
Aborting due to runtime error 7 (null pointer access) at line 184 of C:\Programming\other-projects\freebasic-games2-main\space-invaders\gaming.bas::TEXT2SPRITE()
Code: Select all
w = sp.ci(c).image->width
Re: Space Invaders
The call could fail due to not setting the screen mode before calling imageCreate, or because you're passing invalid parameters to it. You can use assertions to check if the parameters are correct.ixiz9 wrote: ↑Jan 02, 2023 3:06where the values should resolve asCode: Select all
dim as fb.Image Ptr img = ImageCreate(wid*xfactor, height*yfactor, RGB(255,0,255), 32)[/tt]
This line is likely returning 0. I could check for that and avoid the crash, but all I could do at that point is abort the program. I have no idea why that call would fail.Code: Select all
dim as fb.Image Ptr img = ImageCreate(24, 24, RGB(255,0,255), 32)[/tt]
Re: Space Invaders
Sure enough:
Code: Select all
C:\Programming\other-projects\freebasic-games2-main\space-invaders\gaming.bas(185): assertion failed at TEXT2SPRITE: sp.ci( c ).image <> 0
Re: Space Invaders
Hi
Thanks for trying it again.
Is this with the latest version that I posted last night?
Did it ask you for a resolution at the start? Which one did you choose?
Thanks for trying it again.
Is this with the latest version that I posted last night?
Did it ask you for a resolution at the start? Which one did you choose?
Re: Space Invaders
Hi paul doe,
I tried this now using the latest Freebasic (1.09) on Windows compiled with both 32 and 64 bit compilers. I tried it on Intel integrated graphics, AMD integrated graphics and NVidia dedicated graphics and I cannont reproduce this error.
Can you provide a little more info on your set up?
I am also happy to send youanother version of the source with added debugging support to try to track down this error.
I tried this now using the latest Freebasic (1.09) on Windows compiled with both 32 and 64 bit compilers. I tried it on Intel integrated graphics, AMD integrated graphics and NVidia dedicated graphics and I cannont reproduce this error.
Can you provide a little more info on your set up?
I am also happy to send youanother version of the source with added debugging support to try to track down this error.
Re: Space Invaders
well
what i see is a broken link error 404
what i see is a broken link error 404
Re: Space Invaders
I had to move the repository for a bit (there's a message about it a little below). Anyway I now moved it back so both links should work.
-
- Posts: 232
- Joined: Apr 10, 2010 11:41
- Location: Japan
- Contact:
Re: Space Invaders
Dear ixiz9;
Thanks to you, I was able to enjoy the nostalgic game on my Win10 PC.
It's winter in Japan right now, but my hands were sweating.
Unfortunately, the game is over before the invaderes icon change.
I want to improve my skills when I have time and enjoy changing scenes.
Thanks to you, I was able to enjoy the nostalgic game on my Win10 PC.
It's winter in Japan right now, but my hands were sweating.
Unfortunately, the game is over before the invaderes icon change.
I want to improve my skills when I have time and enjoy changing scenes.
Re: Space Invaders
Hi Makoto
Thanks so much for you kind words.
Thanks so much for you kind words.
Can you explain a bit more. When do you expect the icon to change?Makoto WATANABE wrote: ↑Jan 18, 2023 15:30 Unfortunately, the game is over before the invaderes icon change.