Ultimate Amiga

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: How to switch between screen and copy/paste Bob  (Read 2732 times)

0 Members and 1 Guest are viewing this topic.

xboxisfinished

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 205
  • Generic Amiga User
    • gamemakermagazine.com
How to switch between screen and copy/paste Bob
« on: March 03, 2019, 08:56:47 PM »

   Hello,

I have two bobs: one bob for player 1 and one bob for player 2 (I am making a tic tac toe game). I want when I plot a new player into the board...not to use a  brand new bob to plot it for player 1 or player 2...i want to copy my original bob and just paste it in coordinate X,Y in the board. I want to be able to paste as much bobs I want and not be restricted by the limitation of the sprite of the hardware which is 64. I also want to copy/paste bob of player 1 as well when in the first turn. When I paste the bob in the board I do not want it to disappear if I hover over it or if the screen is refreshed or buffering...I want it to stay there stuck (until I remove it by code). Anyone here can help me in this matter?

Second request, ones I paste the bob if I want to replace them or clear them...how do I replace the pasted bob or clear it off the screen?

Third and final request, I want to be able to use screen 1 to have the title screen but when I want to also switch screens for new page and then be able to return back to previous screen without losing any contents of that screen. How do I go about doing that?

For example...assume I am in title screen and I select Play Game...I want to be able to go to a new screen and play the game correctly...and if I quit the game to switch back to the original screen with the title and do not need to redraw anything or something like that. But the previous screen is paused because it no longer have the focus until the focus returns back to it.

if I am playing the game and I win...I want to be able to switch to another screen and have all effects that says that player such and such won this round...new turn starts and then it switches back to the previous screen with the board of the game and starting fresh and so on.

How do I go about doing that?

Logged

adrazar

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 69
  • Generic Amiga User
Re: How to switch between screen and copy/paste Bob
« Reply #1 on: March 04, 2019, 07:24:36 PM »

I'm fairly skilled with Bobs, so I can help you here :D

First however, are you going to use just two Bobs, one for each player? If so it might be easier to simply use two sprites instead. Anyway, if you are going to paste something under a Bob, this is the way to do it:

Code: [Select]
Bob Update Off : Rem Turn off automatic Bob drawing
Do
   X=X Screen(X Mouse) : Y=Y Screen(Y Mouse)
   Bob 0,X,Y,1
   Wait Vbl

   Bob Clear
   'All drawing must be done BETWEEN Bob Clear and Bob Draw
   If Mouse Click Then Paste Bob X,Y,2
   Bob Draw
Loop

Does "screen is refreshed or buffering" refer to Double Buffer or something else? Either may be problematic but it's hard to tell without more info.

So for the second request; to remove a pasted bob is a bit of a bother unless it was pasted on a solid colour background. In that case it's a simple matter of using Bar to remove it, otherwise you will have to save the background somehow before you paste the bob. One way to do this is with Get Block. Another way is actually to use Bobs instead of Paste Bob, because Bobs automatically saves the background underneath. That's the easiest way to go in my opinion.

Screen to Front switches between different opened screens.
Logged
Pages: [1]   Go Up
 

TinyPortal 2.2.2 © 2005-2022