Search found 106 matches

by MrVertigo
Thu Jul 27, 2023 3:18 am
Forum: Development
Topic: Using Inkeys
Replies: 23
Views: 13611

Re: Using Inkeys

I’m not trying to do diagonal movement, or have multiple key presses. I think some confusion has occurred. I am only moving left and right. But I have multiple enemies onscreen. I didn’t find my left and right controls to be responsive enough, because INKEYS only works when the program is at that li...
by MrVertigo
Mon Jul 24, 2023 3:04 pm
Forum: Development
Topic: Using Inkeys
Replies: 23
Views: 13611

Re: Using Inkeys

The root of my problem is that the window of opportunity for inputing a command rushes past too fast with INKEYS. I didn’t know until now that some computers other than the ZX81 need a number after their INKEYS command, to define how many milliseconds the computer waits for an INKEYS command before ...
by MrVertigo
Sun Jul 23, 2023 10:16 pm
Forum: Development
Topic: Using Inkeys
Replies: 23
Views: 13611

Re: Using Inkeys

XavSnap wrote: Sun Jul 23, 2023 9:48 pm Hi,
Mr. Vertigo, prefer this "LET" syntaxe:
[equal symbol]
20 IF K$="q" THEN LET Y=Y-1

Should be: [FASTER]
10 LET X=X+(INKEY$ AND "P")-(INKEY$ AND "O")
20 LET Y=Y+(INKEY$ AND "A")-(INKEY$ AND "Q")
This looks promising! I’ll give it a try. Thanks!
by MrVertigo
Sun Jul 23, 2023 10:15 pm
Forum: Development
Topic: Using Inkeys
Replies: 23
Views: 13611

Re: Using Inkeys

1024MAK wrote: Sun Jul 23, 2023 9:03 pm An alternative is to only perform one action per main loop other than checking the keyboard.

Use a counter to determine which action occurs on which iteration of the loop.

Mark
Nice idea!
by MrVertigo
Sun Jul 23, 2023 7:12 pm
Forum: Development
Topic: Using Inkeys
Replies: 23
Views: 13611

Re: Using Inkeys

I’ve found putting a For/Next loop around the Inkeys routine helps, but it seems like a bizarre solution :|
by MrVertigo
Sun Jul 23, 2023 5:31 pm
Forum: Development
Topic: Using Inkeys
Replies: 23
Views: 13611

Re: Using Inkeys

10 LET K$=INKEY$ 20 IF K$="q" THEN LET Y+Y-1 30 IF K$="a" THEN LET Y+Y+1 40 IF K$="o" THEN LET X+X-1 50 IF K$="p" THEN LET X+X+1 That’s the method I’ve been using, but I have a few “enemy” movements within my loop, and the control keys are VERY unresponsive. So I tried having a few Inkeys functions...
by MrVertigo
Sun Jul 23, 2023 3:15 pm
Forum: Development
Topic: Using Inkeys
Replies: 23
Views: 13611

Using Inkeys

If you’re making a game in BASIC on the ZX81, and you have a couple of movement routines controlling enemies, what is the best way to get an INKEYS movement from the player to feel responsive? Do you have to place a few inkeys checks throughout the game loop? Is it better to peek last_k, or does tha...
by MrVertigo
Mon Jul 17, 2023 3:51 pm
Forum: ZX BASIC
Topic: Multiple Missiles
Replies: 6
Views: 6341

Re: Multiple Missiles

I will study them with interest!
by MrVertigo
Mon Jul 17, 2023 1:56 pm
Forum: ZX BASIC
Topic: Multiple Missiles
Replies: 6
Views: 6341

Re: Multiple Missiles

That would be a busy screen :D
by MrVertigo
Mon Jul 17, 2023 12:23 pm
Forum: ZX BASIC
Topic: Multiple Missiles
Replies: 6
Views: 6341

Re: Multiple Missiles

Thank you! I was thinking an array must be involved somehow, but I couldn’t think how. As you say, probably not something I’d use in the real world, but I just couldn’t think how it could be done. When using machine code on the ZX81 would there be a limit to how many missiles and enemy missiles coul...