Page 2 of 2

Re: Working on an RPG. Test phase, could use ideas

Posted: Tue Jan 11, 2022 8:14 pm
by XavSnap
Déjà vu...

viewtopic.php?p=45304#p45304

Sorry, can't understand your understanding....

Re: Working on an RPG. Test phase, could use ideas

Posted: Wed Jan 12, 2022 1:31 am
by Crayon21
I still don't know how to move characters, it's been troubling me for a while, As i want to make stuff like space invaders. For now, the idea is to make the the characters, plop them in and move them around. once I can do that, I will concentrate on the story, then the design.

Any help for moving characters using customized keys would be appreciated. Xav gave me an example but I have no clue as to where the specific code segment is, he never specified. I have read on the Inkey$ command but there is no instruction in the zx81 manual (what I am aiming for eventually) to move an object on screen, nor the code to do so. I will check the speccy manual and will let you know if i need additional help.

I've seen some of the games for the 81 and it boggles my mind as how to even start. At best, I can plot back and forth but not much else.
By the time CGC2022 rolls around, I hope to at least have some form of idea of what to do.

thanks

Re: Working on an RPG. Test phase, could use ideas

Posted: Wed Jan 12, 2022 9:31 am
by dr beep
Crayon21 wrote: Wed Jan 12, 2022 1:31 am I still don't know how to move characters, it's been troubling me for a while

thanks
To move a charcater you need to place a character somewhere where it starts and then erase the character and show it on the new place.
You can control the place by altering the variables where you do the PRINT AT of the character.

I am keeping it a bit cryptic so you need to try yourself or you won’t get the idea behind the method.

Find games in BASIC that do this and read the listing. many magazines have listing with examples.

Re: Working on an RPG. Test phase, could use ideas

Posted: Wed Jan 12, 2022 9:39 am
by Lardo Boffin
Edit - dr beep beat me to it!

Conceptually speaking moving a character on the screen is quite simple. In a very simple game loop for space invaders:

1 Draw characters on screen at current position
2 Check for player key press
3 If keypress valid set new player position (or shoot missile etc.)
4 Do game logic (move missiles and bombs, collision detection, increase score or decrease lives etc.)
5 If lives = 0 stop and show score
6 Un-plot characters (draw the background over the character)
7 Goto 1

Imagine you are trying to explain to a person who does not understand computers how your game works - write it all down as a list like above or even a flow chart.

Assuming you can plot a character on the screen at a specific location you know virtually everything you need to get going. I’m not very familiar with ZX81 BASIC but something like:

PRINT AT X,Y,”M” (draw missile at x,y)
LET X=X+1 (change missile position as part of game logic stage)
PRINT AT X-1,Y,” “ (draw background over old position, hence X-1)
PRINT AT X,Y,”M” (draw missile at new position)

Or course the above would run really slowly in BASIC (assuming I guessed the syntax correctly) but it would run.

Re: Working on an RPG. Test phase, could use ideas

Posted: Wed Jan 12, 2022 6:00 pm
by XavSnap
Moving a character on the screen...

Déjà vu

viewtopic.php?f=5&t=4454

Tutoral from the CGC Crayon's program.

Re: Working on an RPG. Test phase, could use ideas

Posted: Wed Jan 12, 2022 11:52 pm
by Crayon21
Thanks for the help guys