Jump to content
IGNORED

FB : display more than 4 Players and Missiles


shaoth

Recommended Posts

Hi !

I still test FB, a great language.

A little video of my coding : 

 

Is it possible to display several instance of a player to display more than 3 enemies at the same time ?

Like in Space Invaders for example

 

 

Edited by shaoth
  • Like 5
Link to comment
Share on other sites

RE using the PMg is no miracle.

If you want to do that several times in a scanline, you have to create small programs. For the start, a DLI that is running at the full height of a re used objects. Just set them in the code to the new position.

As you move them horizontally, You'd have to change DLI Code from frame to frame.

The easiest way might be to set a row of NOP commands. You have to find the best positions while writing the code.

Be aware that this type of multiplexing gets worse, the more the objects move to the left. 

 

If you just want to re use them on the screen (attack wave) , in other games the solution was to set the position horizontally, if they vertically do not cross.

 

Space invaders did not do it that way. The main attack waves have been built, using the scrolling Background. The PMG is just some separate moving ships and shots.

 

Link to comment
Share on other sites

Hi!

7 hours ago, shaoth said:

A little video of my coding : 

Looks great!

 

7 hours ago, shaoth said:

Is it possible to display several instance of a player to display more than 3 enemies at the same time ?

Like in Space Invaders for example

Well, it is not that simple. I would recommend three ways:

1) Display all enemies at the same horizontal position, using the same players for all. This is really simple, and if you do vertical movement it would look random enough.

2) Use only one color for each enemy, so you can have two on the same horizontal position. Combine with the above for many enemies on the screen.

3) Add flicker: display one enemy in the even frames and another in the even frames. This will make the enemies look dimmer and flicker, but on real TVs the flicker is not that visible.

 

After that options, you would need a display kernel, this is code that runs in coordination with the computer display, so you can alter the player positions mid-screen. The general version of this is difficult to implement, as you would need to update positions on multiple vertical lines and you can't have two enemies on the same vertical position at the same time.

 

But, if you only want to split the screen at a fixed position and use different horizontal player positions on each half, this is possible with a fixed DLI. Next FastBasic version would allow that, but it is not simple to implement correctly.

 

Have Fun!

  • Like 1
Link to comment
Share on other sites

i am not that familiar with fast basic, but the movement of the enemy spaceship is not 100% smooth. i guess it is a matter of limitation of fast basic and timing.

 

As for using more than the hardware PMGs the A8 support, the straight forward answer is no. the actual answer is yes, using a trick called mutli-plexing PMGs.

you can refer to my  CC65 tutorial on DLI. it is in C language, but i explain the basics, so you can read and learn on how to use the powerful DLI. if you scroll down to the end you will see a sample demo which does exactly the multiplexing. 

the idea is to use the same players on the same vertical position but you keep changing there horizontal position using the DLI.

for example, in your game you could have multiple enemies flying at the same time on different y positions using the same player.

 

hope this helps and let me know if you need any other help

cheers

 

EDIT: here is a link to my tutorial

 

Edited by Yaron Nir
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...