Show Posts

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.


Messages - Gets

Pages: [1] 2
1
Benefits of drawing rectangles should be greater with larger images, especially if they're designed with the format in mind. hardware boxes are also much faster when handling transparencies.

2
QB64 Discussion / Re: QB64 Game Jam
« on: February 14, 2021, 10:12:33 pm »
Quote from: 40wattstudio
My only real suggestion for improvement: Sometimes it can get a little hectic trying to manage your anti-gravity ball, dodge enemies by jumping and positioning oneself correctly to punch other ones. Maybe simplify the anti-matter weapon since that takes the most concentration as one always has to consider if the projectile is still moving, stopped or returning.

Yeah, probably would help a bit to remove the returning portion and have it fade out over time. 

Quote from: Adrian
When I get to the stage as shown in the attached screenshot, I can leave my character and she never loses any lives or energy despite being hit by the laser bombs. :)

The bombs fade out shortly after they're fired, so hopefully you're just at the perfect distance for them to disappear right before hitting you.

3
QB64 Discussion / Re: QB64 Game Jam
« on: February 14, 2021, 04:30:09 pm »
I didn't finish on time for this one and probably would have less time in the future so I don't know if I'd be able to participate, but it's a fun experience if you have the time for it. Would be a good idea to announce directly from the main QB64 twitter account before it starts, maybe.

Anyways, after getting some sleep I was able to fix the problem I had compiling, so I attached my game here.

It's a simple side scrolling action game where you can make use of a antigravity shot. It tosses everything it touches into the air, so you can use it as a shield, to navigate the screen, etc. As a shield it neutralizes energy fire and causes the bullets to harm enemies instead.

Controls:

Keyboard

esc: exits

left, right : run

up,down: aim gravity shot

x: jump
c: punch
spacebar: gravity shot - first press shoots, second press activates it, third recalls it.

Also works with gamepad

On my gamepad, A jumps, X punches and Y is the gravity shot, but I didn't have time to set up any kind of option to configure controls

4
QB64 Discussion / Re: QB64 Game Jam
« on: February 13, 2021, 06:13:34 am »
I thought I was done, but was hit with a compilation error at literally the last minute, so that's that I guess. I can reuse some of the code elsewhere, at least.

5
QB64 Discussion / Re: QB64 Game Jam
« on: January 30, 2021, 03:33:26 pm »
Changing the date won't make much of a difference unless some promotion is done to attract new participants, and it's hard to tell how many QB64 programmers interested in a jam actually exist in the first place.

6
QB64 Discussion / Re: Hi Lo without Secret Number?
« on: October 11, 2020, 07:10:14 pm »
You know the Hi Lo Number Guessing Game where you keep guessing until you guess a secret number between 1 and 100.

Could you tell if the game had no secret number? Can you create such a game?

A correct answer would be generated by high/low responses regardless of whether it was chosen before the game started, and reaching that value is exactly where players would be able to tell no such number existed.

So the goal of such a program would be to keep track of previous guesses and responses and give false information for as long as possible without getting caught. Basically looking for an opportunity to tell the player that 31 is low, after it already said 30 is high, without the player noticing.

It's doable, but probably needs to be based on a more complex game in order to really pull it off.

Something like a Rubix Cube that shuffles squares around when  you aren't looking.

7
thats why I was using such a small ALPHA value so the outer rings have less effect than the inner ones(eventually it would be solid black, Black is what I am expecting by the time the ellipse get close to the center due to the overlap effect). But why is everything turning grey?

it is still destroying the colors, turning everything grey.
Unless there is something I am missing?


The colors blend with each layer, so they become increasingly grey each time until you're just blending grey with grey.I'm not sure of why they specific shade of grey keeps coming up though, maybe it's just the limit of what can be reached with an alpha of 2.

Anyways, if you keep that in mind and limit how many layers you create as well as increase the opacity as you get closer to the center, you get a better effect. I made the ellipse larger for a smoother overall blend and added a light tint to it.

Loop code

Code: QB64: [Select]
  1. j = 0
  2. i% = 0
  3. WHILE i% < 640
  4.     'CIRCLE (320, 240), i%, _RGBA32(0, 0, 0, 256 - i% * .75), , , 3 / 4
  5.     EllipseFill 320, 240, 640 - i%, 480 - i% * .75, _RGBA32(50 - i% / 8, 25 - i% / 5, 15 - i% / 3, j * (.05 + (i% / 180)))
  6.     j = j + .2
  7.     i% = i% + j
  8.  

Not much rhyme or reason to the numbers. I just kept adjusting them until it looked decent. j adjusts the rate that it increments towards the centers and the alpha also increases as well; the tint begins with more red but that color also depletes the fastest.

8
Cloning seems like it would work extremely well with creating expansion packs for older games. I played a few roms that were hacked to do something similar, but that obviously provides a lot less freedom on the development end than reverse engineering the entire engine.

9
QB64 Discussion / Re: Implied
« on: August 28, 2020, 04:35:24 pm »
Because the topic was about the IMP operator there was a focus on bit manipulation in the replies, but you don't need to worry about that if you just want to associate colors with gender.

I had something similar in the example I posted earlier, but

Code: [Select]

Type Colordata

Col as string
gender as string

End type

Dim Colors(10) as Colordata

Colors(1).Col="Blue"
Colors(1).gender="Male"



That's the simplest form. The array will keep the associated colors and gender together, so you can just manually enter them.

If you really want to have a color *imply* a gender, then you don't need the IMP operator, you  can just create a function that checks each color for qualities that determine what gender to associate it with:


Code: [Select]

Function AssignGender(col as _unsigned long)

Male=1
Female=2

    IF _BLUE32(col) > 200 AND _RED32(col) < 200 THEN AssignGender = Male

    IF _RED32(col) > 200 AND _BLUE32(col) < 200 THEN AssignGender = Female

END FUNCTION



If you send a 32-bit color value to that function(using RGB32), then it will perform a simple check and return a result that's either Male(1), Female(2) or neither(0). In this example, a comparatively large amount of blue implies that the color is for males while red implies that it's for females. But you can create  whatever conditions you want, and based on what you tell it it will return the appropriate gender for every single 32 bit color.


It's definitely worth looking into how bits work and will help your understanding of what's actually happening in your programs;variable limits, how things work in memory, etc. But for the actual problem in front of you, you should focus on getting it to *work* in the simplest form possible. Once  you've done that, you can save the program and slowly improve it to be more efficient, dynamic, procedural etc. See if you can get the program to work using what you already understand, and then do the experimenting safely on top of that or separately.

10
QB64 Discussion / Re: Implied
« on: August 24, 2020, 10:25:22 pm »
With IMP, 0 always turns a bit on and 1 always leaves it alone, so it works kind of like a bit mask where you can turn on a set of bits without effecting the rest:&B11101110 IMP X would be used to flip on the first and fifth bit in a byte, for instance.

so if a=1 and c=3 then, assuming they're unsigned bytes

c IMP a would equal 253. Only the second bit would be off.
Likewise a IMP c would equal 255, just flipping everything on

If you're not looking for those kinds of values,IMP won't help you form an association between a and c. You want to introduce some kind of unique change that you can then identify later.

Quote
Hoping to input a color which is then to imply a gender but I'm missing something.

This doesn't use IMP, but it does tag colors with gender values:

Code: [Select]


TYPE ColorType

    val AS INTEGER 'holds color value and gender tags
    title AS STRING 'name for the color

END TYPE

CONST Male = 1 'first bit
CONST Female = 2 'second bit

'A color with both bits off has no assignment, only the first bit is on is for males, only the second bit is on is for females, and both on would count as unisex

DIM Colors(10) AS ColorType

RESTORE colors
FOR i = 1 TO 10

    'since the first two bits are used to identify sex, the base color values are multiples of 4; then a random sex assignment value is added to them

    Colors(i).val = (4 * i) + INT(RND * 4)
    READ Colors(i).title

    PRINT "Color #";i; " is "; Colors(i).title; ", a color for "; GetGender$(Colors(i).val); " as can be seen by the color assignment value which is "; Colors(i).val MOD 4

NEXT i




colors:

DATA "RED","GREEN","BLUE","PURPLE","ORANGE","BROWN","BLACK","HEART","ATTACK","JACK"



FUNCTION GetGender$ (v)


    IF v AND Male THEN m = 1
    IF v AND Female THEN f = 2

    'v MOD 4 would have worked too, but only because everything in this example program is neatly arranged with multiples of 4.

    SELECT CASE m + f

        CASE 0

            GetGender$ = "which there are currently no assignments"

        CASE 1

            GetGender$ = "males!"

        CASE 2

            GetGender$ = "females!"

        CASE 3

            GetGender$ = "everyone!"



    END SELECT


END FUNCTION



11
Programs / Re: Space shooter - full game in development
« on: August 14, 2020, 02:55:18 pm »
You can do it with image files. Use memimage to access the image data in memory, dump it to a file, and then load them into a new image. @SMcNeill  made a utility long ago that handles that and compresses the data with zlib so that it's not much larger than ordinary image files on disk.

I don't know what could be done with sound files though; That aspect of QB64 seems to be pretty limited, but you can always try finding a library that handles things better if there really are no native solutions. For example, Dav posted an example of loading a sound from a string using a Win API call:

https://www.qb64.org/forum/index.php?topic=2887.0


12
QB64 Discussion / Re: QB64 REPORT S01E06: "Game development"
« on: August 12, 2020, 01:53:01 pm »
Qbasic had a solid development community. The "this was made in Qbasic!?" you heard with Black Annex was the exact same thing you heard with games made almost 20 years before that. Some people think modern systems allow for Qbasic to be able to muscle its way through games that would have been impossible in the past, but the reality is that older games were all made at lower resolutions with less color using less RAM, so no one would have run into any walls trying to make similar games back then. I think the big limits in Qbasic were file size and native RAM limitations rather than the language itself holding people back, but libraries that removed a lot of the limitations were available.

The biggest lesson for me in developing games was how simple the basic design for them could be.And of course, the design had to be simple because hundreds of games were being released every year, but the fact that the complexity of my favorite shooter might have just been the same as a version of Pong where your paddle shoots balls that blow up other paddles was a revelation. Something like Final Fight uses the same basic system, but you have an animation play before the collision detection, and instead of making the other character disappear, you check their state and play the appropriate response animation. That's it. Under the hood, a substantial portion of 2D action game catalog can be reduced to Pong ports.

if you can move an object around on the screen, tell when it touches another object, and make something happen as a result, you've created a basic core engine for 2D action games


Because of that, I think Fellipe's Particle simulation is actually a perfect introduction to game design and how simple it actually is. Ignoring all of the design theory and game loops and all that for a moment; Fellipe created, in a few minutes, a program that put objects on the screen, moved them around, had them react to each other and respond to player input. How much time would it take to fully gamify that?

You could base the game around protecting some vital cell from attack by surrounding the invaders. The player can use the mouse to control a boss particle that sends commands to and tugs on the particles it connects to. You can create multiple types of particles that behave differently, increasing the strategic range; gain power ups for every enemy surrounded,etc.   You can spend 3 days optimizing it all to a Game Jam level of quality. You can spend months working on graphics, sound and interfaces to create a polished indie game, or spice it up for a year with a full fledged story mode and completely overhauled graphics engine.

But the majority of the work on the game itself would have been done on that first day of putting together the basic system. Everything that follows is just deciding what to do with the game you've already created. A lot of the QB64 games in text mode or using simple line art simply aren't devoting a lot of energy to dressing the games up in obvious ways.

13
QB64 Discussion / Re: Color overlay routine
« on: August 11, 2020, 11:34:48 pm »
Yeah, I had assumed adding a color to _rgba(0, 0, 0, 0) would just result in the color I added, that seems to be incorrect.  Intuitively it seems like it should be correct, but it isn't.


Seems like you can place the color directly with MEM commands when you really need to; PSET didn’t work when I tested it right now...which I’m glad I just realized because I’ve been using PSET to create a gradient map to use with Hardware images

14
QB64 Discussion / Re: Color overlay routine
« on: August 11, 2020, 08:05:41 pm »
h~& is being blended with black when you draw the box, so you end up with a different color.  You'd have to calculate what the new color is in order to clear it properly, and POINT is perfectly up to the job.

15
You should be able to, just check Microsoft's documentation on how it's done. There are some examples in the wiki on how to use Windows libraries with QB64. You probably won't be able to get around saving relevant variables if you want it to restart where you left off though.

Pages: [1] 2