gfxgfxFreeBASIC Games Directory Forumgfxgfx
gfx gfx
gfx
Welcome, Guest. Please login or register. March 22, 2019, 07:11:01 PM

Login with username, password and session length
10.03.2019 - Round 1 results of our "A Love Letter For FreeBASIC" game dev competition have been published. Please be sure to check the results thread: http://games.freebasic.net/forum/index.php?topic=629.0. Don't forget that the competition is continuing with a round 2, lasting till 8th of April, 300 USD first prize. Stay tuned!
gfx
gfx
*
gfxgfx
gfxgfx gfxgfx
gfxgfx Home Help Search Login Register   gfxgfx
gfx gfx
gfx
Pages: [1]
Print
Author Topic: Breakout Multiplayer: How?  (Read 11182 times)
KristopherWindsor
Forum Sage
*****
Gender: Male
Posts: 363


The Thirsty Smiley


View Profile WWW Email
« on: July 16, 2008, 01:18:14 AM »

I was thinking that in the 2-player mode, one player will have the mouse, and the other will have the keyboard.
There will be twice as many paddles, and the paddles will be half the width (compared to the single player version).
To simplify the programming, only player one will control the ball and missile launching (with the mouse button).

Does anyone have a better idea?
Would it be practical to use USB game controllers to support more than two players?

 Grin
Logged

Tusike
Novice
***
Gender: Male
Posts: 95

varnaipeti@hotmail.com
View Profile Email
« Reply #1 on: July 16, 2008, 07:23:32 AM »

How does the mouse work? Is the x coordinate of the paddle replaced by the mouse's every time, or is a number added or subtracted from the paddle's x based on the mouse's x?

Difference: First option allows fast movement of paddle
Second will have the paddle "slowly" moving towards the mouse

If you plan on using arrow keys for the second player I suggest using the second option.

Btw, how can you have so much bricks without a grid with that many balls, and still run the same speed as if only one ball where present?

-Tusike
Logged
KristopherWindsor
Forum Sage
*****
Gender: Male
Posts: 363


The Thirsty Smiley


View Profile WWW Email
« Reply #2 on: July 16, 2008, 12:10:49 PM »

How does the mouse work? Is the x coordinate of the paddle replaced by the mouse's every time, or is a number added or subtracted from the paddle's x based on the mouse's x?

Difference: First option allows fast movement of paddle
Second will have the paddle "slowly" moving towards the mouse

If you plan on using arrow keys for the second player I suggest using the second option.

I already have that for the one-player mode; there are control:x/y/click variables, and the paddles move towards them.

  With utility_mouse
    .update()
    If .c.sx <> .p.sx Or .c.sy <> .p.sy Then game.input_usemouse = true
  End With
 
  With game
    .input_key_x = Abs(Multikey(&h4D)) - Abs(Multikey(&h4B))
    .input_key_y = Abs(Multikey(&h50)) - Abs(Multikey(&h48))
    If .input_key_x <> 0 Or .input_key_y <> 0 Then .input_usemouse = false
  End With
 
  With game
    If .input_usemouse Then
      .control_x = utility_mouse.c.sx
      .control_y = utility_mouse.c.sy
    Else
      .control_x += .input_key_x * .input_keyspeed
      If .control_x < 0 Then .control_x = 0
      If .control_x >= data_screen.default_sx Then .control_x = data_screen.default_sx - 1
      .control_y += .input_key_y * .input_keyspeed
      If .control_y < 0 Then .control_y = 0
      If .control_y >= data_screen.default_sy Then .control_y = data_screen.default_sy - 1
    End If
    .control_click = utility_mouse.c.b > 0 Or Multikey(fb.sc_space)
  End With

Quote
Btw, how can you have so much bricks without a grid with that many balls, and still run the same speed as if only one ball where present?

-Tusike

What? I don't understand. Tongue
The game is optimized (all bricks are drawn on the same image, so they can be drawn to the screen with one Put call) and has a good framerate control object. Cheesy
Logged

Lachie Dazdarian
Double dipper
Administrator
Forum Sage
*****
Gender: Male
Posts: 1301


lachie13
View Profile WWW Email
« Reply #3 on: July 16, 2008, 04:47:25 PM »

I'm still not clear on the gameplay to give a constructive answer on this. But I don't see much fun in only launching the balls and fireing the missles. For me, the only game where mouse and keyboard make sense is where mouse involves aiming or steering.
Logged

"Things like Basic and Free Basic provide much-needed therapy and a return to sanity and a correct appreciation of people. The arrogant folk really hate a word like 'Basic' - fine, and good riddance." ~ pragmatist
KristopherWindsor
Forum Sage
*****
Gender: Male
Posts: 363


The Thirsty Smiley


View Profile WWW Email
« Reply #4 on: July 16, 2008, 08:03:43 PM »

I'm still not clear on the gameplay to give a constructive answer on this. But I don't see much fun in only launching the balls and firing the missiles. For me, the only game where mouse and keyboard make sense is where mouse involves aiming or steering.

I think you misunderstood. My idea was (slightly changed):
- Player 1 controls half of the paddles with the mouse
- Player 2 controls the other half of the paddles with the keyboard
- If either player presses the button to launch / fire, then all lasers fire, and all balls are released (so it would make sense for only Player 1 to bother holding the button down)
Logged

Tusike
Novice
***
Gender: Male
Posts: 95

varnaipeti@hotmail.com
View Profile Email
« Reply #5 on: July 16, 2008, 11:57:44 PM »

Are you saying that it's faster to redraw the whole screen every frame than to just "undraw" things that move and draw them again?

I won't be here for the next month.
Happy programming!

-Tusike
Logged
Leonheart
Novice
***
Posts: 54


tenchu_shinobi_taizen
View Profile WWW
« Reply #6 on: July 17, 2008, 12:18:08 AM »

Better make small lan support for multiplayer. So maybe can get all 32 player paddle at one screen. Make a 32 paddle in one row, so the ball can't escape. Tongue
Logged

Even just one flap of butterfly can make storm in the world.
KristopherWindsor
Forum Sage
*****
Gender: Male
Posts: 363


The Thirsty Smiley


View Profile WWW Email
« Reply #7 on: July 17, 2008, 12:38:21 AM »

Better make small lan support for multiplayer. So maybe can get all 32 player paddle at one screen. Make a 32 paddle in one row, so the ball can't escape. Tongue

I think LAN is beyond the scope of the casual / downloadable / shareware genre. Wink
Logged

KristopherWindsor
Forum Sage
*****
Gender: Male
Posts: 363


The Thirsty Smiley


View Profile WWW Email
« Reply #8 on: July 17, 2008, 12:46:30 AM »

Are you saying that it's faster to redraw the whole screen every frame than to just "undraw" things that move and draw them again?

I won't be here for the next month.
Happy programming!

-Tusike

I didn't say that; I said it is faster than redrawing each of the 500 bricks individually each frame. Wink
You'll need to see a video or demo of this game to see all the effects, but if you saw how much was moving on the screen you would see it is impossible to just undraw a few things.
All of the bricks can be animated, there are particles everywhere, the bricks and paddles fly all over the screen when broken, and the entire screen is drawn with "put alpha, alphavalue," so one frame is blended onto the next. Smiley

Actually I was surprised; on some levels the game can get > 40FPS at 1680 * 1050. Cheesy Cheesy Cheesy
Logged

Pages: [1]
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
Cerberus design by Bloc
Valid XHTML 1.0! Valid CSS!
gfx
gfxgfx gfxgfx