old QB Defender game - anyone want to try to bring this up to speed?
#31
Hi MadsciJr

about this goal

Quote:Another thing to fix I realized is the test for the presence of a joystick needs to come inside the menu loop, at the top. That way you can plug a controller in without having to restart the program.
for now it is not possible because the _device keyword is in development.

See this post about it _devices in development

about

Quote:As a general rule I always like to declare my variables all together near the top. First constants, second types, third shared variables.
this is often my way to code.


about

Quote:real arcade game with original sprites and rework code to use sprites and fix routines that draw the landscape.


at your posted link there are good information and links to images (astroship, enemies and alphabet)  and sprite info for game engine ( defender sprites list )  and this basic information  
Quote:The classic Williams video arcade games - Defender, Stargate, Robotron, Joust, Bubbles, Sinistar - all run on essentially the same platform. They can all display 304 x 256 pixels, using 16 colors at a time out of a hardware palette of 256. The horizontally- oriented games (all the games except Sinistar) display the byte at memory...
Here a first code to start from zero:

Code: (Select All)
'QBDefender from zero to code
' The classic Williams video arcade games - Defender, Stargate, Robotron, Joust, Bubbles, Sinistar -
' all run on essentially the same platform. They can all display 304 x 256 pixels, using 16 colors
' at a time out of a hardware palette of 256. The horizontally- oriented games (all the games
' except Sinistar) display the byte at memory

Rem PART 1: The screen
Dim Main&
Main& = _NewImage(304, 256, 256)
' setting to 256 colors we needn't using the Palette tecnique for getting 256 colors on the screen
Screen Main&
_FullScreen
For n = 1 To 256
    'pset (n,1),n
    Line (n, 1)-(n, 256), n, BF
Next n






more information here walktrough Defender and here wikipedia page.
Reply
#32
(05-02-2023, 11:10 AM)TempodiBasic Wrote:
Quote:Another thing to fix I realized is the test for the presence of a joystick needs to come inside the menu loop, at the top. That way you can plug a controller in without having to restart the program.
for now it is not possible because the _device keyword is in development.

See this post about it _devices in development

I'll give a look - so is _devices currently broken in QB64PE?
If it's just something they will fix in an upcoming release, we can just develop with an older version where it was working, or QB64 2.0.2?

Anyway, I've been meaning to get back to this, just been busy. I will check all those links and post some updates when I get more time.

Cheers!
Reply
#33
Devices has a tendency to miss some keypresses (Alt, Shift, Ctrl keys are a couple from what I remember), and the changes should fix that.  AFAIK, these upcoming changes don't break anything, though some of the return codes might be different now due to where they were bugged and mismapped in the past -- which is why I mentioned anyone wanting to work with Devices, or write a library with it, might want to grab the latest development build from the repo.  Then, when you're coding button values, you'll have the correct return values and not code towards the mismapped ones.
Reply
#34
Hi Steve
in the while of the evolution of _DEVICES for multiple sequential use in testing the presence or absence of a USB Joystick 
what do you suggest as external OS library?  Is Xinput.h  useful or do you have some better tips?

Thank you for feedbacks
Reply
#35
(05-08-2023, 09:29 PM)TempodiBasic Wrote: Hi Steve
in the while of the evolution of _DEVICES for multiple sequential use in testing the presence or absence of a USB Joystick 
what do you suggest as external OS library?  Is Xinput.h  useful or do you have some better tips?

Thank you for feedbacks

I tend to use _Devices without any issues with my USB Joystick.  Spriggsy had a windows XInput library, which you might give a try, if you want to; otherwise I can't think of anyone else who has a different joystick library off the top of my head.
Reply
#36
Hi Steve
Thanks,
surely I'll search in the section of Spriggsy his device library. It has at my eyes 2 advantages, 1. it is already modeled to fit QB64pe features, 2. it is made by Spriggsy.


After many attempts to get results about the SEARCH field of the forum I think to send a DM to Spriggsy asking  his library.
In the while I found these interesting links by google
RawInput,  Xinput windowsWin32 JoystickAPI.h
Reply
#37
(05-09-2023, 05:29 PM)TempodiBasic Wrote: Hi Steve
Thanks,
surely I'll search in the section of Spriggsy his device library. It has at my eyes 2 advantages, 1. it is already modeled to fit QB64pe features, 2. it is made by Spriggsy.


After many attempts to get results about the SEARCH field of the forum I think to send a DM to Spriggsy asking  his library.
In the while I found these interesting links by google
RawInput,  Xinput windowsWin32 JoystickAPI.h

Hiya Tempodi - sorry for disappearing, things have just gotten very busy for me around here. 
I started on simplifying my game controller and keyboard detecting & mapping code, which works pretty good, and will try to make some progress over the weekend and post here when I have it up and running. Meanwhile, feel free to play with Spriggsy's libraries. I just wonder if they're cross-platform (you know how he loves his API functions!)
Reply
#38
(05-09-2023, 12:12 AM)SMcNeill Wrote:
(05-08-2023, 09:29 PM)TempodiBasic Wrote: Hi Steve
in the while of the evolution of _DEVICES for multiple sequential use in testing the presence or absence of a USB Joystick 
what do you suggest as external OS library?  Is Xinput.h  useful or do you have some better tips?

Thank you for feedbacks

I tend to use _Devices without any issues with my USB Joystick.  Spriggsy had a windows XInput library, which you might give a try, if you want to; otherwise I can't think of anyone else who has a different joystick library off the top of my head.

I had a joystick & keyboard mapping + input library which worked. I just added both versions to my "prolific programmer" page:
Here are some other solutions / approaches / threads for this (3 of them are yours!):
I'm going to drastically simplify my game input mapping system. We'll see how that goes!
Reply
#39
Hi MadSciJr

be quiet, also I know what it means to have so little time to spend for own projects.

I have not understood if you like to write code together me or if you like to have only some feedbacks about your work.
In the first case I should like to know what part of the program do you pass to me and what do you want manage.

For now I can say you that the Dbox consolitade game device input does not pass the test of PlugIn and Unplug the device while program is running.
Simple Joystick Input with Stick and Strig is a Steve Thread in which there are also my code  testing Stick and Strig. LOL the time passes
the same we can say about Programmable Keyboard Input  at this link IT codepage for Programmable Keyboard Input

I have asked to SpriggsySprigs his library based on Xinput API.

In the thread of the last link there is a my answer with issue using DEVICE. here you can see my post in that thread

No news under the sun!
Reply
#40
(05-14-2023, 07:08 PM)TempodiBasic Wrote: Hi MadSciJr

be quiet, also I know what it means to have so little time to spend for own projects.

I have not understood if you like to write code together me or if you like to have only some feedbacks about your work.
In the first case I should like to know what part of the program do you pass to me and what do you want manage.

For now I can say you that the Dbox consolitade game device input does not pass the test of PlugIn and Unplug the device while program is running.
Simple Joystick Input with Stick and Strig is a Steve Thread in which there are also my code. LOL the time passes
the same we ca say about Programmable Keyboard Input. 

I have asked to SpriggsySprigs his library based on Xinput API.

In the thread of the last link there is a my answer with issue using DEVICE.

No news under the sun!

Thanks for your reply!

Sorry for not being clear about the level of involvment I was looking for. For this project I was just looking to share the code and put the project out there for someone to run with (someone with more time and talent than me! :-) I have tried to fix things here and there to get the basic program working, but I'm not looking to lead this one.
Reply




Users browsing this thread: 10 Guest(s)