News:

PlayBASIC2DLL V0.99 Revision I Commercial Edition released! - Convert PlayBASIC programs to super fast Machine Code. 

Main Menu

AstroBreak - the final version

Started by thaaks, March 09, 2006, 03:20:47 PM

Previous topic - Next topic

thaaks

I started work on the final version of AstroBreak.

This thread will show you the progress and shall give you a chance to suggest improvements or features to add. Once in a while I will add screenshots or download links.

I already added the classic movement of Asteroids - so now you can rotate your ship and move independently in another direction.

Planned features:
- PlayBasic intro screen and sponsors screen, I liked it in JetPak and I think Kevin and the sponsors deserve it, so I will add something similar
- More powerups and powerdowns (any nice ideas?)
- More aliens, different movement routines of them (not just horizontal, also more than one at the same time)
- More visual effects (Scoring points, particles, smoke trails?)
- High score table
- Maybe different ships to select with different properties (speed, builtin default weapon)

Any other ideas you would like to see?

Cheers,
Tommy

Ian Price

Glad to see you doing more work on it Thaaks - I too am adding new stuff into JetPak.

As for the splashscreens, I'm glad you liked the idea - it's only fair that Kevin/PlayBASIC/UnderWareDesign and the sponsors get the credit they deserve for putting in time, effort and money.

As for extras, one thing I found hard with your game is the scrolling star background. On my LCD monitor they don't work well at all. Perhaps having a scrolling image (planets, nebula etc.) in the background would produce a kinder result on the eyes and reduce repetetive nature of rock-blasting.

Other than that (and the steering, that you've now fixed) the game was fine. :)
I came. I saw. I played some Nintendo.

Bustaballs

I demand an extra dimention with a battle system like Freelancer!
QuoteOh please

Tracy

Hi Tommy.

I had a lot of fun playing Astrobreak, so I thought I'd contribute my two cents. I'm an old-school ateroids fan.

The 'feel' of the game is a little off to me. It had been a while since I played the original asteroids and so it took me a bit to figure out what it was. After playing Astrobreak some more, it finally came to me that it was a mixture of a few different factors. First, the collision radius of the ship seems to be slightly bigger than the ship, which makes daredevil asteroid flyby's pretty unforgivingly difficult to pull off. If you get near an asteroid, you're down. I'd have more fun with it if I had the room to be a bit more free with my flying.

To go along with the above, the playable area feels a little crowded. In the original asteroids, you had a LOT of room to maneuvre because the ship was so small compared to the 'playing field.' In astrobreak, I feel like if I move faster than almost-as-slow-as-I-can I'm asking to hit an asteroid. It makes me feel a bit hobbled.

Third, in asteroids you could move one direction and fire another. While the car-steering isn't necessarily a bad thing, you have a much higher turning radius when you have to car steer (if you're moving) , and that adds to the crampedness of the board.

As for powerups, some sort of AE weapon wold be cool, even if it had limited ammo. It'd be fun to take out a batch of asteroids with a single shot if you can aim it properly.

Additionally, maybe adding a shot that would move in a straight line until it hit not one, but two or three asteroids and THEN vanish might be fun. Maybe shots that bounced off of the screen edges instead of wrapped around, or a spread shot that fired bullets off in more than one angle.

An obvious addition that you have probably already considered is a powerup that gives you some sort of shield allowing you to take an extra hit.

Maybe as a combined powerup/powerdown you could have a particularly powerful weapon that disabled your engines so you're forced to stay still while you blast away at everything for dear life for a few seconds. Just a thought.

Anyway, strong work overall. No matter what you decide to do with it I look forward to the updated versions. Cheers.

-Tracy

thaaks

Yes, nearly forgot about the collision area. You're right (and also the judges mentioned that): the collision zone is too big for the ship. I will fix that.

Thanks for the weapon/powerup suggestions.

The "classic" steering is already in, just need to add some configuration menu to switch between your favorite steering method.

Cheers,
Tommy

kevin

re collision:

  Personally I think it's better it have the collision zones slightly smaller than the graphic. So for the asteroids pull them in a bit just  they lay inside the rotation of the object.   If a circle won't fit, shape collision would really assist here.  

  In the case of the ship a simple triangle shape would easily suffice.  It doesn't have to be perfect representation of the image mind you, as that can be too touchy.  Just enough so the outline represents the hard region of the object.

thaaks

Kevin: Thanks for the reminder - I will have a look at shape collision. Wanted to do so since the recent discussions in one of the forums here...

kevin

The compo version of AstroBreak is now on the http://www.PBcode.underwaredesign.com

thaaks

Cool - some kind of fame at last  :D

Thanks, Kevin.

But where is the DigDug remake and Jetpak?

Cheers,
Tommy

kevin

QuoteBut where is the DigDug remake and Jetpak?

No source for digdug,  in fact I have no idea what their doing.  

Was going to upload Jetpak later.

thaaks

I am currently working on the shape collision for the player's ship.
Here is my code snippet (assuming that "s" is an already existing Sprite with the player ship image attached to it):

    img = GetSpriteImage(s)
   ; create the shape
    shp = GetFreeShape()
    CreateShape shp, 5, 5
    SetShapeVertex shp, 1, 32, 5
    SetShapeVertex shp, 2, 56, 50
    SetShapeVertex shp, 3, 8, 50
    SetShapeEdge shp, 1, 1, 2
    SetShapeEdge shp, 2, 2, 3
    SetShapeEdge shp, 3, 3, 1
    ImageShape img, shp
    SpriteCollisionMode s, 3

It's working so far. But sometimes it seems that asteroids, aliens or bullets just pass through and collisions do not work. Or it seems that one shape edge is working and the others are not.
So my question is: Do I have to set the shape vertices or edges in a certain way like clockwise or counterclockwise?
Or am I doing something wrong?

Cheers,
Tommy

kevin

#11
That seems ok, but you'll post a something i can actaully test.  But, i don't recall having those problems before

thaaks

Haha, nailed it!

The problem is related to the collisiondebugmode!

In the following code collisions work differently if the global DebugCollisions in the 13th line is set to true or to false.


; PROJECT : ShapeCollision
; AUTHOR  : Tommy Haaks
; CREATED : 17.03.2006
; EDITED  : 17.03.2006
; ---------------------------------------------------------------------
Explicit True

; ---------------------------------------------------------------------
;       Testing Pixel Perfect Sprite Collision with Vector Shapes
; ---------------------------------------------------------------------

; change DebugCollisions to false to completely mess up the shape / circle collision!!!
Global DebugCollisions = True

Global ShipSprite, AlienImage, shp, img

Global sw, sh; screenwidth and height

Global MaxSprites, lp, flashcolour, ThisSprite, NextSprite

; load the ship as image 1
ShipSprite = LoadSprite(1, "ship.png", 2); make it an FX image
; setup shape collision for the player ship
shp = GetFreeShape()
CreateShape shp, 5, 5
SetShapeVertex shp, 1, 32, 5
SetShapeVertex shp, 2, 56, 50
SetShapeVertex shp, 3, 8, 50
SetShapeEdge shp, 1, 1, 2
SetShapeEdge shp, 2, 2, 3
SetShapeEdge shp, 3, 3, 1
img = GetSpriteImage(ShipSprite)
ImageShape img, shp
SpriteCollision ShipSprite, True
SpriteCollisionMode ShipSprite, 3
PositionSprite ShipSprite,Rnd(sw),Rnd(sh)
SpriteCollisionDebug ShipSprite, DebugCollisions


; load the alien as image 2
AlienImage = 2
LoadImage "ufo64.png", AlienImage
;  prepare image #2 as FX iamge
PrepareFXImage AlienImage

; Tell PB to direct all drawing back to the screen
RenderToScreen

; Get the Width/height of screen
sw=GetScreenWidth()
sh=GetScreenHeight()


; Create a bunch of randomly positioned alien sprites
MaxSprites=10
For lp=2 To MaxSprites
 ; CReate this sprite
CreateSprite lp
 ; Assign Image #2 to this sprite
SpriteImage lp,2
 ; Set Sprites Draw Mode to Rotated
SpriteDrawMode lp,2
 ; Enable Sprite Collision For this sprite
SpriteCollision lp,True
 ; Enable this Sprites Collsion Class (the class/group it belong too)
SpriteCollisionClass lp,3
; Set this sprites Collision mode to "circle"
SpriteCollisionMode lp,2
SpriteCollisionRadius lp, 32
AutoCenterSpriteHandle lp,1
SpriteCollisionDebug lp,DebugCollisions

; Randomly Position this sprite on the screen
PositionSprite LP,Rnd(sw),Rnd(sh)
Next


; =====================================
; Start of the Main DO/LOOp
; =====================================

Do
; Clear the Screen to black
Cls 0

; Display a message
Print "Sprite Collision - Shape Mode"
Print "Touch the WHITE region in the sprite"

; Run through and Turn/Rotate all the sprites
For lp=2 To MaxSprites
 TurnSprite lp,1
Next

; Position The users Test Sprite #1, at the mouses position
PositionSprite ShipSprite,MouseX(),MouseY()
; rotate the ship on left mouse click
If MouseButton() = 1
TurnSprite ShipSprite, 1
EndIf


flashcolour=0  

RemStart
; Check If the Users Sprite Has Hit any of the rotating sprites
NextSprite=GetFirstSprite()
Repeat
 ThisSprite=SpriteHit(1,NextSprite,%0010)
 If ThisSprite>0
   NextSprite=GetNextSprite(ThisSprite)
   FlashColour=$770000
 EndIf
Until ThisSprite=0
RemEnd
 For lp = 2 To 10
   If SpritesOverlap(lp, ShipSprite)
     FlashColour=$770000
   EndIf
 Next
   

; If there was an impact, Flash the Screen RED
If flashcolour
 Cls Flashcolour
Else
 Print "No Impacts"
EndIf

; Draw all the sprites
DrawAllSprites

; Show the Screen
Sync

; Loop back to the previous DO statement to keep the demo running
Loop



Psub LoadSprite(spr, name$,mode)
Local im

   im=GetFreeImage()
   LoadImage name$,im  
   PrepareFXImage im
   CreateSprite spr
   
AutoCenterSpriteHandle spr,1
   SpriteImage spr,im
   
  ; SpriteDrawMode 2 means the sprite image can be rotated.  Other modes use the original image.
   If mode=2 Then SpriteDrawMode spr,2
EndPsub spr

You'll need the two attached images or take them from my AstroBreak sources.
[attachmentid=544]
[attachmentid=545]

I also upload two screenshots showing the misbehavior.
Debug collision mode on, collisions working properly.
[attachmentid=546]
Debug collision mode off, collisions not working correctly.
[attachmentid=547]

Phew! Your turn, Kevin  :D

Cheers,
Tommy

kevin


kevin

Ok this drama is now fixed in PB1.27.  

It's a logic drama caused by the shape buffer was not being refreshed prior to being used.  It works when you draw the collision modes as drawshape (which is used for sprite debug) calls RefreshShape as part of that process. I'll be adding a RefreshShape command so the use can fiorce a refresh when ever you like.  It's best not done often as works out the bournding box/circle of the vertex for collisions.


Given that, you can trick the curent version into working, simply by drawing the shape once.  This will init the shapes vertex's and it should work as normal from then on.


ie.  Build it and draw it off scree


; load the ship as image 1
ShipSprite = LoadSprite(1, "ship.png", 2); make it an FX image
; setup shape collision for the player ship
shp = GetFreeShape()
CreateShape shp, 5, 5
SetShapeVertex shp, 1, 32, 5
SetShapeVertex shp, 2, 56, 50
SetShapeVertex shp, 3, 8, 50
SetShapeEdge shp, 1, 1, 2
SetShapeEdge shp, 2, 2, 3
SetShapeEdge shp, 3, 3, 1

drawshape shp,2000,0,2 ;<<<<<<<<<< draw way off screen to force it to refresh