Do
control routine...
if player moving then do frame of movement...
if NPCs are moving then move NPCs a frame of movement....
do other house keeping....
build screen....
display screen...
delay...
Loop until quit
and execution needs to be constant.Hi Cobalt. Is very hard to say, what is wrong without real source code. If your character step is 32 pixels, try use something as this:
when(IF) the character starts moving they don't stop until the array errors out.1. the sprite array for animation uses an index used also for the other events of the game ?
Can't shut down the whole execution to move the player cause there are other NPCs that need to be able to move in time with the player. so this has to happen 'in flow' E2. Do NPCs use player's moves to do their move?
the character finishes moving even if direction key is no longer pressed, so if the player is halfway through a tile the animation needs to finish them into the next tile before stopping.3. do you like to end move when character gains the end of the tile where it is now?
Do4. How does control_routine pass the Inputs/commands to this general engine_Loop?
control routine...
if player moving then do frame of movement...
if NPCs are moving then move NPCs a frame of movement....
do other house keeping....
build screen....
display screen...
delay...
Loop until quit
Hi Cobalt, thank you, i try it. Which IDE version you use? Unknown statement _SETBIT found on line 436.
I commented on rows that use the command above. I'm confused by your colission function. I have never seen a similar example of using SELECT CASE. Are you really sure that the function returns the expected results? I prefer to use a two-dimensional array for this type of detection.see lines 286-289, that is all debugging and represents those 4 '0's along the right hand of the screen. if the bottom number turns -1 its found a collision. Which uses an array(PLACE(27,45,45)) and checks which sprite is displayed for 'walkable' and 'not walkable'.
Hi Cobaltthere are, simply enough, only 2 frames for each direction and the TIMER(T(0)) simply toggles the Frame%% value. It has no other barring on the program.
I confirm the experience of Petr if I load your code into QB64.
about the issue please answer to these questions:
1. the sprite array for animation uses an index used also for the other events of the game ?
2. Do NPCs use player's moves to do their move?They will use a mirror of the same routine. Just with the NPCs data set. With random chance to change direction and\or move.
3. do you like to end move when character gains the end of the tile where it is now?Unless the player still has the key pressed (_KEYDOWN) for the current direction of movement then it needs to keep moving 'smoothly' without a jitter each time the player finishes onto a tile.
4. How does control_routine pass the Inputs/commands to this general engine_Loop?In this incarnation of failure, it simply sets the direction the player is facing then turns on a TIMER. Which runs the MOVE_PLAYER routine. Which sets the Moving flag. I have used the Controls routine to return a flag value to have the routine move_player called from the main loop too, again failure.
syntax _SETBIT(VariableToset, parameter?%)
_SETBIT sets the high/low bit (or nibble) of a variable following the action activated by parameter?%
Parameter?% can have these values ?-?-?-? or this range of values min??-max??
As you can see, the player acquires the target position no matter what speed it is going...
I added a dwell whenever a target has been hit.
Modified again to show that the square player image is precisely located correctly in place.
Quote from: TempodiBasic on Yesterday at 08:07:13 AM
4. How does control_routine pass the Inputs/commands to this general engine_Loop?
In this incarnation of failure, it simply sets the direction the player is facing then turns on a TIMER. Which runs the MOVE_PLAYER routine. Which sets the Moving flag. I have used the Controls routine to return a flag value to have the routine move_player called from the main loop too, again failure.
so _SETBIT is one of your innovations for QB64
and I am fear that we must wait just some time before we can go on trying your code after downloading the new version of QB64 from github that has into it your innovations!
Why not make a SUB setbit? What are SUBs for anyway? I guess Cobalt is probably using C bit shifting operations but it can all be done in pure QB.
Still a bunch of stray _SETBIT in this latest code block.
I've REMed the bithandling out for now if you guys want to try it