Author Topic: Trampoline Gunmen III - beta build of my new game!  (Read 774 times)

Sketcz

  • Newbie
  • *
  • Posts: 16
Trampoline Gunmen III - beta build of my new game!
« on: August 06, 2011, 10:02:13 AM »
Trampoline Gunmen III - Triple Strike

BETA

09 August 2011


ALT and ENTER for FULLSCREEN

http://www.megaupload.com/?d=OTL0WY3X

This is just an early test version of Trampoline Gunmen III.

I've also included a bonus file called BOUNCY, which is the main game without barriers at the edges of the trampolines. Neat, huh?



6 of the planned 7 characters implemented (the 7th might be omitted due to workload), basic phsycis/engine in place. Weapons, ammo reloading, and so on. Blood splats. No Special Powers implemented yet. Kill the other player to restart the round.




I realise it's rough as hell, but I wanted to get this out there incomplete because:

a) It could do with some testing to point out bugs I missed.

b) I need some feedback on well balanced the characters are. They still need their Special Power attacks added, but maybe their stats also need tweaking?

c) I'm a little burned out by this and might never complete it.

d) I'd like someone to provide chip tunes or music for it, otherwise I'm just going to rip some Street Fighter music. Credit will be given, but the game is freeware so do it just for fun.




Please share your views on the game. Is it fun? Is there enough variety between characters? How does it look? Would some chiptunes in WAV format be cool? How does it compare to previous TG games? Is Hobo too difficult to use? Is Jeffer too powerful?

Do the battles drag on for too long? I'm not convinced I've got the balance right for the health bars and duration of battles.

If possible try to play against someone else, otherwise there's not much point to it.



Please keep in mind I am both lazy and unskilled at coding, so some gameplay suggestions are probably beyond my ability/patience.





Stuff to add:
1) AI for single player
2) Backgrounds for each character
3) Music for every stage
4) Sound files, like yelling, gunshots, reloading, and belching/farting for hobo when he speed changes
5) Endings for single player
6) A proper ROUND START for each fight
7) proper conclusion for battles (1p and 2p)
8) A series of single player mini games (probably will never happen)
9) Character power attacks
10) Possible 7th character with boomerang attack



Controls:

w = p1 up
S = p1 down
a = p1 left
d = p1 right
spc = p1 fire

arrows for 2p
p = 2p fire

r = reset

j = activate blood splat (for testing purposes)

m = music OFF (only during fight)

+ increase speed

- decrease speed

esc = quite


RULES:
Set the speed. The lower the number the faster it goes. If your PC can't run it at 1, then it can't run it. It actually needs to run fairly slow-ish for the animation to look right, so don't be afraid to go high. My computer runs at it well at around 100.

Use the + and - buttons to increase and decrease speed.

Fire in the same direction as travel to slow down.
Fire in the opposite direction of travel to speed up.
Just like a space rocket.
Kill opponent.

Please let me know if you discover bugs or want to give feedback. I don't know if I'll ever finish this. Probably not!



OLD POST:
I've decided to make TRAMPOLINE GUNMEN 3.

But in order to handle the bullets I want to create my first Array. I have never been able to do this before. usually I learn something new either from the QB HELP files or by playing with bits of other people's programs (a good way to learn), but I have never been able to understand arrays.

The problem is, I've never found an easy to experiment with example. I found used for a Pacman game, and I sort of managed to alter it, but I couldn't work out to implement it in my own games.

So! If I supply some starting code, can someone insert a small block of code which implements what I can need, and is simple enough that I can then edit it as needed and hopefully, from that point on, be able to use arrays on my own.

Well, that's the best idea I could come up with. I'm basically asking for someone to write a piece of code for me, but hopefully once I have seen it within the context of my game, I can then understand it and be able to use it in future.



Basically if you push FIRE and if your ammo is > 0 then it goes to the firing SUB. I'd like it so that every time it goes to this sub it creates a bullet that flies along the screen and disappears at the end. The most will probably be around 6 bullets, or maybe 10, assuming someone has a max ammo capacity of 3 and 5, and fires all of them before and right after replenishing ammo.

Is this confusing? I'm not very good at this as you'll soon see! :)

If you need me to clarify any bits here (or remove stuff not related to the bullets, please let me know.


Code: [Select]
CLEAR
RANDOMIZE TIMER
SCREEN 13
CLS

INPUT "SPEED", timez

P1energ = 100 ' energy for p1
P2energ = 100 'energy for p2
P1pow = 10 ' power for p1
P2pow = 25 ' power for p2
countdown = 99 ' timer
P1name$ = "Murphy"
P2name$ = "Elizay"
p1ammo = 3 'p1 ammo count
p1x = 25 ' Player 1 horizontal position
p1y = 50 ' Player 1 vertical position
p1dir = 1 'this dictates up or down / 1 = down 0 = up
p2dir = 1


LOCATE 25, 18
PRINT "0 / 0"
LOCATE 25, 2
PRINT "Ammo"
LOCATE 25, 35
PRINT "Ammo"


'start of main game loop
'**********************************************************************
'**********************************************************************
MAINGAMELOOP:

timr = timr + 1
IF timr > timez THEN GOSUB SECONDARY 'counts main loop before going to animation sub

LINE (5, 20)-(315, 180), 15, B 'arena boundary
LINE (5, 0)-((5 + P1energ), 7), (62 + (P1energ / 10)), BF 'player 1 energy bar
LINE (105, 0)-((5 + P1energ), 7), 0, BF 'player 1 energy bar
LINE (315, 0)-((315 - P2energ), 7), (62 + (P2energ / 10)), BF 'player 2 energy bar
LINE (215, 0)-((315 - P2energ), 7), 0, BF 'player 2 energy bar
LINE (5, 10)-((4 + P1pow), 16), (60.4 - (P1pow / 10)), BF 'player 1 energy bar
LINE (54, 10)-((5 + P1pow), 16), 22, BF 'player 1 energy bar
LINE (315, 10)-((315 - P2pow), 16), (60.4 - (P2pow / 10)), BF 'player 2 energy bar
LINE (264, 10)-((314 - P2pow), 16), 22, BF 'player 2 energy bar
PSET (6, 179) 'P1 trampoline
DRAW "TA0S4 E6F6H6 R35 G6E6F6"
PSET (267, 179) 'P2 trampoline
DRAW "TA0S4 E6F6H6 R35 G6E6F6"

IF p1y > 169 THEN 'trampoline animation
    LINE (12, 173)-(p1x + 2, p1y + 4), 15
    LINE (46, 173)-(p1x + 2, p1y + 4), 15
    LINE (13, p1y + 4)-(47, p1y + 4), 0
END IF



LOCATE 1, 18 ' countdown for the round timer
PRINT "TIMER"
LOCATE 2, 19 ' countdown for the round timer
PRINT CINT(countdown)
LOCATE 2, 8
PRINT P1name$
LOCATE 2, 28
PRINT P2name$
'PRINT CHR$(5)    ' use this for winner's stars?


PSET (p1x, p1y)
DRAW "TA0S4C4D4Rc12U4R3F1G2REH3C2L2u2h2r2buc6u2er2glbdc14r2dl2bdc50r3gl3fr2d2c12l2"
PSET (p1x - 2 + p1dir, p1y - 4 - p1dir)
DRAW "TA0S4 C14d2 C6G2Rdruuruc7r9dc8l8dc14lbr6bu rbhbulu "


IF p1shot = 1 THEN 'if a bullet is active
    PSET (p1shotx, p1shotY)
    DRAW "TA0S4 C14 u2r3fgl3blc0u3"
END IF




SELECT CASE INKEY$
    CASE CHR$(0) + "H": timez = timez + 1 'UP ARROW
    CASE CHR$(0) + "P": timez = timez - 1 'DOWN ARROW
    CASE CHR$(0) + "K": P1pow = P1pow + 1 ' LEFT ARROW
    CASE CHR$(0) + "M": P1pow = P1pow - 1 'RIGHT ARROW
    CASE CHR$(119): END ' W BUTTON
    CASE CHR$(115): END ' S BUTTON
    CASE CHR$(97): IF p1hori > -.2 THEN p1hori = p1hori - .2 ' A BUTTON
    CASE CHR$(100): IF p1hori < .2 THEN p1hori = p1hori + .2 ' D BUTTON
    CASE CHR$(32): IF p1ammo > 0 THEN GOSUB p1shoot ' SPACE
    CASE CHR$(27): END
END SELECT


GOTO MAINGAMELOOP
'end of main game loop
'**********************************************************************
'**********************************************************************



p1shoot:    ' THIS IS AFTER YOU HAVE PRESSED THE FIRE BUTTON
p1ammo = p1ammo - 1 'removes one ammo
LINE (16, 185)-(34, 192), 0, BF 'deletes ammo pic

'these 3 lines activate the bullet by setting x and y position
p1shotx = p1x + 3
p1shotY = p1y
p1shot = 1 ' this line specifically means that Bullet #1 is now ON

RETURN




' START OF SECONDARY LOOP
'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
SECONDARY:
timr = 0
countdown = countdown - .5 'timer for the ROUND TO END

LINE (p1x - 4, p1y - 10)-(p1x + 9, p1y + 5), 0, BF ' block to black out P1

PSET (18, 32) '********* AMMO BOX for P1
DRAW "TA0S4 C2r20u10l20d10 BE3 C14U2EFD2LBR3C14U2EFD2LBR3C14U2EFD2LBR3C14U2EFD2LBR3"
PSET (281, 32) '********* AMMO BOX for P1
DRAW "TA0S4 C2r20u10l20d10 BE3 C14U2EFD2LBR3C14U2EFD2LBR3C14U2EFD2LBR3C14U2EFD2LBR3"


p1x = p1x + p1hori ' this line moves the guy left or right
IF p1x < 14 THEN p1hori = 0 ' these 2 lines stop the guy fall off his trampoline
IF p1x > 41 THEN p1hori = 0

IF p1dir = 1 THEN p1y = p1y + .2
IF p1dir = 0 THEN p1y = p1y - .2
p1y = p1y + .03 'this line means he goes up slower

IF p1y <= 37 THEN
    p1dir = 1
    p1y = p1y + 1
    p1ammo = 3
END IF



IF p1y >= 174 THEN p1dir = 0

IF p1shot = 1 THEN p1shotx = p1shotx + 1 ' moves bullet is Bullet #1 is ON
IF p1shotx > 315 THEN p1shot = 0 ' switches Bullet #1 OFF if it goes over edge of screen

IF p1ammo > 0 THEN LINE (16, 185)-(20, 192), 14, BF
IF p1ammo > 1 THEN LINE (23, 185)-(27, 192), 14, BF
IF p1ammo > 2 THEN LINE (30, 185)-(34, 192), 14, BF

RETURN

« Last Edit: August 09, 2011, 10:55:19 AM by Sketcz »

TerryRitchie

  • Hero Member
  • *****
  • Posts: 2268
  • FORMAT C:\ /Q /U /AUTOTEST (How to repair Win8)
    • Email
Re: Help me make an array for my new game
« Reply #1 on: August 06, 2011, 12:32:13 PM »
In order to create an array to handle something like bullets, you also need a TYPE declaration.

TYPE bullet
  x AS SINGLE   ' x location on screen
  y AS SINGLE   ' y location on screen
  c AS INTEGER ' counter to countdown time remaining on screen
  vx AS SINGLE ' x vector direction of bullet
  vy AS SINGLE ' y vector direction of bullet
END TYPE

Next you need to create an array to hold the TYPE.

DIM bullets(10) AS bullet

The above line created 10 containers to hold up to 10 bullets that could be on the screen at any given time.

Now, you can set each bullet's values by referencing the array number.

bullets(1).x = 100
bullets(1).y = 100
bullets(1).c = 50
bullets(1).vx = 1 ' bullet will travel to the right
bullets(1).vy = -1 ' bullet will travel up as well (45 degrees for this bullet)

Of course, handling each bullet manually would be hard at best, so you could keep track of a shot counter in your code.  When the player shoots a bullet, the bullet info would get set, bullets(shotcounter%).x =, and so on.  Once your bullet info is set, you increment the shot counter. If the shot counter reaches 11 reset it back to 1.

Now, inside of a FOR...NEXT loop you would look to see if a bullet is active (c), and if so move it to it's next position

FOR bulletcount% = 1 TO 10 '                                                                             cycle through all 10 possible bullets
  IF bullets(bulletcount%).c > 0 THEN '                                                                is the counter > 0? If so, bullet is still active
    bullets(bulletcount%).x = bullets(bulletcount%).x + bullets(bulletcount%).vx '  add the x vector to the current x position of bullet
    bullets(bulletcount%).y = bullets(bulletcount%).y + bullets(bulletcount%).vy '  add the y vector to the current y position of the bullet
    bullets(bulletcount%).c = bullets(bulletcount%).c - 1 '                                     decrement the life counter
    PSET (bullets(bulletcount%).x, bullets(bulletcount%).y), _RGB(255, 255, 255) ' draw the bullet on the screen at location x,y
  END IF
NEXT bulletcount%

« Last Edit: August 06, 2011, 02:58:15 PM by TerryRitchie »

Clippy

  • Hero Member
  • *****
  • Posts: 16446
  • I LOVE π = 4 * ATN(1)    Use the QB64 WIKI >>>
    • Pete's Qbasic Site
    • Email
Re: Help me make an array for my new game
« Reply #2 on: August 06, 2011, 12:37:58 PM »
QB64 WIKI: Main Page
Download Q-Basics Code Demo: Q-Basics.zip
Download QB64 BAT, IconAdder and VBS shortcuts: QB64BAT.zip
Download QB64 DLL files in a ZIP: Program64.zip

Sketcz

  • Newbie
  • *
  • Posts: 16
Re: Help me make an array for my new game
« Reply #3 on: August 06, 2011, 02:21:42 PM »
Thank you Terry Ritchie! I got it working quite easily with that explanation! :D

What a relief that is. Took over a decade but I think I've got the hang of Arrays hopefully.

It was especially easy since the bullets in my TG games only go in one direction and they're only live while onscreen, so I could cut out a few variables.

I might try using this new found knowledge in other ways, perhaps making some neat special effects.


@Clippy
I have the entire Wiki saved to my HDD and I read those pages a few times, but none of the examples are easily translated into a game scenario (not in my mind anyway). Compared to say Terry's explanation, where I could copy and paste the code and after a little tweaking it worked right away.

There should be a sub-heading: Using Arrays Specifically for Games ;)

TerryRitchie

  • Hero Member
  • *****
  • Posts: 2268
  • FORMAT C:\ /Q /U /AUTOTEST (How to repair Win8)
    • Email
Re: Help me make an array for my new game
« Reply #4 on: August 06, 2011, 02:34:25 PM »
You're welcome :)

As for special effects you basically have the start of a particle emitter. Create a 100 random "bullets" shooting in all directions and them let them fly.  Using c as a value to calculate distance from origin, fade the particles the farther they go.

If you are interested in game design check out the Sprite Library I just uploaded to the Finished Libraries section.  The tutorial is geared toward toward teaching how to use the engine, but I give some examples of the aspect of game making in the tutorial too.  It also includes the Asteroids game (which uses bullets in the exact same way that I described to you, as well as a particle emitter) and the Space Invaders game I made with the library to learn from.

Also, UnseenMachine has a game development kit that works quite well for 2D games and he is currently building a 3D engine.

Sketcz

  • Newbie
  • *
  • Posts: 16
Re: Help me make an array for my new game
« Reply #5 on: August 07, 2011, 12:50:28 AM »
I thought of a cool idea for a falling cherry blossom effect now that I can do arrays.As a background or foreground element, I could have 20 petals randomly falling in a loop. Should look quite nice when done. Now it's just staying motivated to finish this whole thing (need to keep detailed notes in case I take a long break).

I saw a post about Unseen's 2D game engine. Unfortunately I'm not sure I'm good enough at coding to start making use of things like libraries, engines and so on. I've been doing the graphics with DRAW commands, which is slow and problematic, but it's easy enough and I clearly understand it. It took me a decade to learn arrays, so I'm probably already over my head. :D

Sketcz

  • Newbie
  • *
  • Posts: 16
Re: Trampoline Gunmen III - beta build of my new game!
« Reply #6 on: August 09, 2011, 10:50:49 AM »
Trampoline Gunmen III - the beta build!

http://www.megaupload.com/?d=OTL0WY3X

I've updated my first post with details on it.

Views, gentlemen?

Muffinman

  • Sr. Member
  • ****
  • Posts: 379
Re: Trampoline Gunmen III - beta build of my new game!
« Reply #7 on: August 11, 2011, 02:03:18 PM »
is this like a double dragon unauthorized reboot?  I have to say it sounds exactly 1.5x as sweet!

Sketcz

  • Newbie
  • *
  • Posts: 16
Re: Trampoline Gunmen III - beta build of my new game!
« Reply #8 on: August 12, 2011, 12:33:27 AM »
No, the game concept is original, two dudes on trampolines shooting each other.

The music is a Street Fighter rip which I just put in there as a a placeholder until I've found someone to supply some original music (I'll probably ask on TIGSource at some point).

Cyperium

  • Hero Member
  • *****
  • Posts: 3294
  • Knowledge is good, but understanding is better
    • Cyperium
    • Email
Re: Trampoline Gunmen III - beta build of my new game!
« Reply #9 on: August 13, 2011, 02:26:31 PM »
Tried your game, looks really good! I like the concept!

Lachie Dazdarian

  • Sr. Member
  • ****
  • Posts: 280
    • http://games.freebasic.net
    • Email
Re: Trampoline Gunmen III - beta build of my new game!
« Reply #10 on: August 22, 2011, 12:42:00 PM »
I like the original, but from this remake I kind of expected more.

In other words, this WIP needs much more ironing-out (I keep saying this too much lately). Not sure why the game flickers. Also, you really must learn how to use time-based movement. The game must run at constant speed on almost all PCs! This is quite possible. I can teach you. Other things...AI is a must before I can fully test this game. And for such simple game, it shouldn't be a problem.

And why not choosing a higher resolution on nowadays PCs? Really, screen 13 is too small for today monitors.

Let's hope you can bring this to a higher level.

Sketcz

  • Newbie
  • *
  • Posts: 16
Re: Trampoline Gunmen III - beta build of my new game!
« Reply #11 on: January 19, 2012, 11:22:18 AM »
Hit ALT + ENTER for full screen. I like the low resolution graphics. They're very retro.

Anyway, finally updated this, with backgrounds and special powers. I think I'll leave it there though. It takes up too much time testing it.

Did a blog entry here, in case anyone is interested:
http://blog.hardcoregaming101.net/2012/01/trampoline-gunmen-iii-lucky-strike.html