Main Menu

My second game: Hell Eagle

Started by Sigtrygg, July 05, 2012, 01:54:17 PM

Previous topic - Next topic

Sigtrygg

Hello Community!

I am glad to present you my second game "Hell Eagle"!
You have to save the poor souls from hell, but be aware of the fireballs
and don't touch the rockwalls. The gravity makes it more difficult to land
save onto the landingplatforms.
I had a lot of fun during programming!  :)
The game will come with source code inclusive, of course!
You can download the zipped file at:

http://rghost.net/39058277

Enjoy the game!

Sigtrygg


Check out my other games

Happy Diver

BlinkOk

excellent work dude. that plays really well. it had me on the edge of my seat!

RayRayTea2

Doesn't work on my computer (Windows 7 64 bit). It switches to fullscreen, starts playing the music and crashes.

BlinkOk

im windows 7 64bit and it works ok for me

micky4fun

great little game , had me coming back for more last night , love this type of game , bought back a few memories

mick :)

ATLUS

#5
nice little game!

p.s. i have same problem with win7x64 =(

buggage

Works fine here on Win7 64Bit.

Very Thrust/Oids like. Nice :)

RayRayTea2

ok I discovered what makes it crash:
Monitor rotation.

I have my monitor set to "Landscape", if I set it to "Portrait" it works. If I set it back to "Landscape", it crashes again.

monkeybot

nice job!
No crash on mine Win7 64

Big C.

yes,yes, yes... very good game... good structured sourcecodes

But had the same problems to start the exe only under win 7 64bit  :( its craches...

Sigtrygg

Thank you for your replies!
I am happy that you enjoy the game.   :)
I hope that you can use some parts of the
source code for your projects, too.
It's pitty, that it doesn't work on every
Win 7 64bit system.
I wrote it under WinXP but it runs too under
my Win7 32bit system

I hope someone can give us the reason for
crashing on some win7 64bit system.

So long, have a nice Weekend!

kevin

#11
Sigtrygg,


  Nice little game... Had a look through the source and it seems there's a number places you make improvements.


  So in no particular order,

   * The world could be converted to a map.  (Attached bellow)   (See Play-Pic2map)

        - You could then render this map to an image and continue going about doing the collision the same way, or use the build in map collision functions.   I'd recommend the latter for a couple of reasons.  Such as,  It's saves memory and it's generally faster.


   * There's a number of bits of code that can be better presented using a loop.   Generally making everything Global is bad thing.  

PlayBASIC Code: [Select]
   Global cry1=RndRange# (1, 2300)
Global cry2=RndRange# (1, 2100)
Global cry2=RndRange# (1, 2300)

If cry1=1 Then PlaySound 7
If cry2=1 Then PlaySound 8
If cry3=1 Then PlaySound 9



   Could be,

PlayBASIC Code: [Select]
   for lp2=7 to 9
if RndRange# (1, 2300)=1
PlaySound lp2
endif
next





   * In the world set up code, your loading a unique frame set for every man,  where all we need do it create one copy of the frame sheet and then share that.


PlayBASIC Code: [Select]
For za=1 To 35
men(za)=New people
men(za).speed=RndRange (7,30)
men(za).FrameSheet=LoadFrameSheet("men_animation.png",20,30,RGB(255,0,255),16)
men(za).Anim_men=NewAnim(men(za).FrameSheet,men(za).speed)
Next za



   Could be,


PlayBASIC Code: [Select]
   MenAnimationFrameSheet=LoadFrameSheet("men_animation.png",20,30,RGB(255,0,255),16)
For za=1 To 35
men(za)=New people
men(za).speed=RndRange (7,30)
men(za).FrameSheet=MenAnimationFrameSheet
men(za).Anim_men=NewAnim(men(za).FrameSheet,men(za).speed)
Next za




   The same could be said for the Explosion frame sheets,  rather than loading them on demand, it'd be much better to just one the sheet once, then spawn new animations from the sheet as required.    


   So during startup we could do load our frame sheets a bit like this,

 Global  MenFrameSheet      =LoadFrameSheet("men_animation.png",20,30,RGB(255,0,255),16)
 Global ExplosionFrameSheet=LoadFrameSheet("explosion.png",64,64,RGB(255,0,255),16)

then ,later on in the program we just use those handles for spawning the animations from..

PlayBASIC Code: [Select]
Function explosioncanon()
score=score+500
PlaySound 2
Anim_explosion=NewAnim(ExplosionFrameSheet,1)
For t= 1 To 8
DrawAnim Anim_explosion,cx#(canonnumber)-GetCameraX (1)-32,cy#(canonnumber)-GetCameraY (1)-32,True; Spriteposition minus Camerapos (-32 because of size 64 of framesheet)
Sync
Next t
deleteanim Anim_explosion
EndFunction





      * SpriteHit vs SpritesOverlap ..   If you just want to detect if two sprites are touching, then SpritesOverlap is better choice

  ie.
PlayBASIC Code: [Select]
   ThisSprite=SpriteHit(4,2,%0001)
If ThisSprite=2
explosioneagle()
EndIf




 becomes

PlayBASIC Code: [Select]
   if SpritesOverlap(4,2)
explosioneagle()
EndIf






   * restart()  - This function is leaking media,   namely the MEN frame sheets and animations.     Each time the game called this function is loaded the frame sheets for each man, then spawning a new animation from each man.  Without deleting any previous animations it may have been using.      

   So the reset version if probably better expressed like


PlayBASIC Code: [Select]
;  remove this >>  Dim men(40) As people  don't need

; so the routine runs through and kills any only animation the dude has, and creates a new one from it's old frame sheet
For za=1 To 35
; c
if men(za)
men(za).speed=RndRange (7,30)
DeleteAnim( men(za).Anim_men)
men(za).Anim_men=NewAnim(men(za).FrameSheet,men(za).speed)
endif
Next za




      It'd be better to separate the med setup stuff into a single function really,  rather than have two copies of the basically the same code in the World Setup and Reset functions.   Having only one copy makes tracking down issues and making changes much quicker.    




Quote
I hope someone can give us the reason forcrashing on some win7 64bit system.

 Well, the source is included they should test it themselves.
 

Sigtrygg

Hello Kevin!

Thank you very much for your hints and your efforts!!!
Your hints are very helpful for me and I try to apply them
in future. I knew that there might be some things I could do
more efficiently, but I didn't know how.
I hope that I can improve my programming knowledges now.
:)

Greetings from

Sigtrygg

kevin

Sigtrygg,

Quote
Thank you very much for your hints and your efforts!!! Your hints are very helpful for me and I try to apply them in future. I knew that there might be some things I could do more efficiently, but I didn't know how.

No worries..  So you're just learning to program now ? 

Would you mind if I posted this or your other games in the PlayBASIC.com source code site ?    We need all the example games written by others we can get !


Sigtrygg

Yes, of course you can post the source codes and media on the site
I would be appreciate if you do so, because for me the source code site
and your tutorials were and still are very very helpful.
I try to optimize the source code for the game "Hell Eagle" considering
your hints and then I will post the code again. But it could take some
time...
Best wishes for your father too!

Sigtrygg