UnderwareDESIGN

PlayBASIC => Show Case => Topic started by: Sigtrygg on July 05, 2012, 01:54:17 PM

Title: My second game: Hell Eagle
Post by: Sigtrygg on July 05, 2012, 01:54:17 PM
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 (http://www.underwaredesign.com/forums/index.php?topic=3835.0)
Title: Re: My second game: Hell Eagle
Post by: BlinkOk on July 05, 2012, 08:29:08 PM
excellent work dude. that plays really well. it had me on the edge of my seat!
Title: Re: My second game: Hell Eagle
Post by: RayRayTea2 on July 06, 2012, 02:00:23 AM
Doesn't work on my computer (Windows 7 64 bit). It switches to fullscreen, starts playing the music and crashes.
Title: Re: My second game: Hell Eagle
Post by: BlinkOk on July 06, 2012, 02:08:45 AM
im windows 7 64bit and it works ok for me
Title: Re: My second game: Hell Eagle
Post by: micky4fun on July 06, 2012, 02:18:50 AM
great little game , had me coming back for more last night , love this type of game , bought back a few memories

mick :)
Title: Re: My second game: Hell Eagle
Post by: ATLUS on July 06, 2012, 05:25:08 AM
nice little game!

p.s. i have same problem with win7x64 =(
Title: Re: My second game: Hell Eagle
Post by: buggage on July 06, 2012, 07:06:30 AM
Works fine here on Win7 64Bit.

Very Thrust/Oids like. Nice :)
Title: Re: My second game: Hell Eagle
Post by: RayRayTea2 on July 06, 2012, 08:39:33 AM
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.
Title: Re: My second game: Hell Eagle
Post by: monkeybot on July 06, 2012, 03:35:00 PM
nice job!
No crash on mine Win7 64
Title: Re: My second game: Hell Eagle
Post by: Big C. on July 07, 2012, 06:07:22 AM
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...
Title: Re: My second game: Hell Eagle
Post by: Sigtrygg on July 07, 2012, 10:59:45 AM
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!
Title: Re: My second game: Hell Eagle
Post by: kevin on July 07, 2012, 09:52:38 PM
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 (http://www.underwaredesign.com/forums/index.php?topic=3781.0))

        - 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.  

[pbcode]
   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
[/pbcode]

   Could be,

[pbcode]

   for lp2=7 to 9
      if RndRange# (1, 2300)=1
         PlaySound lp2   
      endif
   next

[/pbcode]


   * 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.


[pbcode]
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
[/pbcode]

   Could be,


[pbcode]

  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
[/pbcode]


   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..

[pbcode]
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  
[/pbcode]



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

  ie.
[pbcode]

   ThisSprite=SpriteHit(4,2,%0001)
   If ThisSprite=2
      explosioneagle()
   EndIf

[/pbcode]

 becomes

[pbcode]

   if SpritesOverlap(4,2)
      explosioneagle()
   EndIf

[/pbcode]



   * 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


[pbcode]
;  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

[/pbcode]

      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.
 
Title: Re: My second game: Hell Eagle
Post by: Sigtrygg on July 08, 2012, 02:12:49 AM
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
Title: Re: My second game: Hell Eagle
Post by: kevin on July 11, 2012, 01:54:15 AM
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 !

Title: Re: My second game: Hell Eagle
Post by: Sigtrygg on July 11, 2012, 12:22:27 PM
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
Title: Re: My second game: Hell Eagle
Post by: kevin on July 18, 2012, 02:15:36 AM
QuoteI 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...

 Looking over the program again (briefly), I think the biggest opportunity for improvement can could found in the rescue() function.  It seems like that for each man character there's custom section code to drive it's action.   The function is about 600 lines of code long, we're we could probably reduce it to less than 100 by simply using a state machine and for/next loop to process the men characters.

 A State Machine is just what name implies, our characters have various states and we can change their behavior by changing the state. The update functions selects what control code to use for each character via it's state field.  Generally via SELECT CASE statement.   The little men characters could have say 2 or 3 different states.   Which might be 1) Standing (to be rescued), 2) Walking/Running to Chopper and  3) Rescued.    


  Here's the layout of the concept (not working code)

[pbcode]
 ; define our states for the various possible states
   Constant PeopleState_Waiting =1
   Constant PeopleState_Running =2
   Constant PeopleState_Rescued =3

   Type people
         State

         x_pos#
         y_pos#
         xto_pos#
         yto_pos#
         speed
         Anim_men
         FrameSheet
   EndType

   Dim men(40) As people




   ; -----------------------------------------------------------------------------------------------
   ; Here's a mock up of how the processing function to control the MEN characters could look like
   ; -----------------------------------------------------------------------------------------------


Function ProcessMen()


   For lp =0 to 40

      ; check if a man exists at this position within the array
      if Men(lp)


         ; Select what STATE this men is in
         Select men(lp).State
   
            ; -------------------------------------      
            case PeopleState_Waiting
            ; -------------------------------------      

               ; Code goes here to animate/render the standing dude
               
               
            
            ; -------------------------------------      
            case PeopleState_Running
            ; -------------------------------------      
   

               ; Check what side of the player the man is on
               if men(lp).X < PLayer.X
                     ; men to the left of player, so move right

                     ; also check if the men hits the pick up point,
                     ; if so, set the man's state to PeopleState_Rescued

               else
               
                     ; men to the left of player, so move right
               
                     ; also check if the men hits the pick up point,
                     ; if so, set the man's state to PeopleState_Rescued

               endif
               
         
         
            ; -------------------------------------      
            case PeopleState_Rescued
            ; -------------------------------------      
   
               ; Do nothing, already picked this dude up.
               ; Here you can actually delete this man from
               ; the array (and any animations he's used)
   



         EndSelect
   
      endif
      
   next

EndFunction

[/pbcode]


   We can further expand this to create conceptual links between the MEN characters and the PLATFORMS.   The simplest way would be to create type for our Platforms and use an array to hold them all within the one structure, just like the men.    To create our links,  we add a field to the PEOPLE type, this field would hold the index of the platform this man responds to.  So when the Player lands on platform SIX say, this platform sets it's player status to TRUE.    Inside the   ProcessMen() each man is checking it's linked platforms status to set it's mode.    So if the playing is sitting on the platform, then the character is set to  PeopleState_Running, if the player isn't sitting on the platform it's set to standing.    


     Again here's some more mock up code of the type of solution.  

[pbcode]


 ; define our states for the various possible states
   Constant PeopleState_Waiting =1
   Constant PeopleState_Running =2
   Constant PeopleState_Rescued =3



   Type tPlatform
         ; is the player sitting on this platform ?
         PlayerLandedStatus

         ; Position in world
         x#,y#

         ; Size   
         Width,Height
   
   EndType

   Dim PLatform(100) as tPlatform




   Type people
         State
         PLatformIndex
         
         x_pos#
         y_pos#
         xto_pos#
         yto_pos#
         speed
         Anim_men
         FrameSheet
   EndType

   Dim men(40) As people





Function ProcessPLatforms()

   ; This function runs through the platforms and check if they hit\
   ; the players sprite.  

   For lp =0 to 100

      ; check if a platforms exists at this position within the array
      if PLatform(lp)

            ; check if platform rect hits the player sprite
            x1=PLatform(lp).x   
            y1=PLatform(lp).y   
            x2=x1+PLatform(lp).Width
            y2=y1+PLatform(lp).Height

            State=False
            if RectHitSpritePixels(x1,y1,x2,y2,Player.Sprite,1)
               State=True            
            Endif
            

            ; here you could check if the rotation of the player to make sure
            ; they're level enough to make a safe landing also

            ; anyway, here we just set the
            PLatform(lp).PlayerLandedStatus=State

      endif
   next   


EndFunction

   ; -----------------------------------------------------------------------------------------------
   ; Here's a mock up of how the processing function to control the MEN characters could look like
   ; -----------------------------------------------------------------------------------------------


Function ProcessMen()


   For lp =0 to 40

      ; check if a man exists at this position within the array
      if Men(lp)


         ; Get the landing platform this man is linked to
         
         MyLandingPlatform=Men(lp).PLatformIndex






         ; Select what STATE this men is in
         Select men(lp).State
   
            ; -------------------------------------      
            case PeopleState_Waiting
            ; -------------------------------------      

               ; Code goes here to animate/render the standing dude
               
                  
               ; check if the player is sitting on this platform
               ; if they are, swap to running mode
               if PLatform(MyLandingPlatform).PlayerLandedStatus = true         
                     men(lp).State=PeopleState_Running
               endif

               
            
            ; -------------------------------------      
            case PeopleState_Running
            ; -------------------------------------      
   

               ; check if the player is NOT sitting on this platform
               ; if they aren't, then set it back to standing
               if PLatform(MyLandingPlatform).PlayerLandedStatus = true         
                     men(lp).State=PeopleState_Waiting
               endif



               ; Check what side of the player the man is on
               if men(lp).X < PLayer.X
                     ; men to the left of player, so move right

                     ; also check if the men hits the pick up point,
                     ; if so, set the man's state to PeopleState_Rescued

               else
               
                     ; men to the left of player, so move right
               
                     ; also check if the men hits the pick up point,
                     ; if so, set the man's state to PeopleState_Rescued

               endif
               



         
         
            ; -------------------------------------      
            case PeopleState_Rescued
            ; -------------------------------------      
   
               ; Do nothing, already picked this dude up.
               ; Here you can actually delete this man from
               ; the array (and any animations he's used)
   



         EndSelect
   
      endif
      
   next

EndFUnction
   
[/pbcode]


  The benefits are too many to list really, apart from being less code, we're simply making our program easier to change without fear of variable collisions and logic errors.  But really one of the best advantages is that we can externalize hard coded DATA from the CODE.  Allowing you create multiple levels easily.



 
Title: Re: My second game: Hell Eagle
Post by: BlinkOk on August 09, 2012, 04:23:29 AM
hey Sigtrygg dude,
this is a really great game mate. i have played it quite a few times.
i was wondering if you would be interested in re skinning it.
there wouldn't be many changes and i don't think it would take up too much of your time.
anyway. just a suggestion.
let me know ok?
Title: Re: My second game: Hell Eagle
Post by: Sigtrygg on August 12, 2012, 02:36:08 PM
Hello BlinkOK!

Do you think to give the game an other look?
Of course, I am interested in.
What is your idea?
At the time I make the game a litle bit larger and
I try to apply some of the hints from Kevin.
When I have finished I will post the game again
together with sourcecode.

Greetings from Sigtrygg
Title: Re: My second game: Hell Eagle
Post by: BlinkOk on August 12, 2012, 04:31:52 PM
ok no worries mate. i'll put something together. it's either a space taxi thingy or an alien space ship and cows at the moment.
Title: Re: My second game: Hell Eagle
Post by: BlinkOk on August 16, 2012, 09:25:27 PM
ok. here's my take on it (right click and view image to see full size);
(http://s1-04.twitpicproxy.com/photos/full/638796210.jpg)

in a post apocalyptic world gone mad...
where cities are suspended in the air by massive girders and cars fly...
chicks in tight little red skirts still manage to get out on a Saturday night!
it is your job to get them home Sunday morning....you are bob the taxi guy!


you gotta get the chicks home. you have to manage fuel and stay away from the rocks/girders.
we could have spikes and stuff that pops up and smashes you and cops that patrol here and there.
we could have power ups like faster speed and invincibility
the more chicks in the car the slower you go and the more fuel you use.

this may take me a little while to get together though. maybe a week
let me know what you think
Title: Re: My second game: Hell Eagle
Post by: kevin on August 17, 2012, 02:13:09 AM

are you going make it multiple (parallax styled) layers  ? 
Title: Re: My second game: Hell Eagle
Post by: micky4fun on August 17, 2012, 02:17:57 AM
Hi all

This looks very stunning indeed , looking forward to this one ,
Quoteare you going make it multiple (parallax styled) layers  ? 
looks the way to go

great stuff
mick :)
Title: Re: My second game: Hell Eagle
Post by: BlinkOk on August 17, 2012, 02:57:47 AM
Quoteare you going make it multiple (parallax styled) layers  ? 
if it's ok with sigtrygg dude then it's definitely a go.
Title: Re: My second game: Hell Eagle
Post by: ATLUS on August 17, 2012, 04:27:25 AM
awesome BlinkOk!!!
Title: Re: My second game: Hell Eagle
Post by: monkeybot on August 17, 2012, 12:12:52 PM
Blink! your graphics are really rather excellent.
Title: Re: My second game: Hell Eagle
Post by: Sigtrygg on August 17, 2012, 03:05:00 PM
Hello BlinkOK!

Your graphics look fantastic!!  :o
In a few days (maybe Monday) I am going to publish a
new version of Hell Eagle. I have apply some hints of Kevin and
made the world larger and I integrated a better highscore-List
with 15 positions. I also made a choice of screen resolution, so
it is possible to run the game on laptops with 1600x900 resolution.
It's pitty that I didn't get an advantage by applying tha map-
function. I tried it, but I didn't get an advantage in speed, but
I have great problems with my sprite-collisions, so I didn't try it
further.
I think the computer today are so fast that it is no problem to
run the game rather somoothly.
Your idea with fuel consumption is good and I thougt of it too!
When I publish the new version of Hell Eagle I do it again with
all media files, so it would be great, if you can change it with your
cool graphics. I would be very appreciate, if we could work
together and make a nice looking game that makes fun! But, if you
want to change it of your own, you are welcome of course.
I don't want the game for me! You all of the community can
change code and media of your own, and can use it how you want!
But of course it would be nice, if you would share your ideas with
us all. It is very exiting, what game we can create.

Greetings,

Sigtrygg
Title: Re: My second game: Hell Eagle
Post by: Sigtrygg on August 20, 2012, 11:32:08 AM
Hello Community!

Here is now Hell Eagle Version 1.2!
I made:
- a better highscoretable
- different screen-resolutions
- larger world
- a special enemy
and also I applied some hints of Kevin for the game.

You can download with source code and media-files:
http://rghost.net/39898639

Have much fun!
I am courious of BlinkOk new graphics for the game.

Greetings

Sigtrygg
Title: Re: My second game: Hell Eagle
Post by: BlinkOk on August 20, 2012, 05:31:08 PM
looks cool Sigtrygg dude. well done. it's a very
engaging game and has me on the edge of my seat when i play it.

you might have one problem with my graphics where you will
need (at least) three HUGH images to make the game.
1. sky/distant background
2. background
3. foreground
i'm not sure but i'm thinking that might be a little too much for some pcs.
maybe a system where you can build up a scene with smaller pieces of
graphics displaying only what the player can see at that moment
Title: Re: My second game: Hell Eagle
Post by: stevmjon on August 20, 2012, 09:45:54 PM
thanks for sharing your game sigtrygg.

hey blinkok, you come up with good graphics so quickly. you da man. you are very creative.

stevmjon
Title: Re: My second game: Hell Eagle
Post by: micky4fun on August 21, 2012, 03:43:27 AM
Hi All




Quotei'm not sure but i'm thinking that might be a little too much for some pcs.
maybe a system where you can build up a scene with smaller pieces of
graphics displaying only what the player can see at that moment

dont know if this might help as i had a simular problem with my airbourne game and Kevin came up with this ,
but i must amit i could not grasp it , but thats my small brain , lol

http://www.underwaredesign.com/forums/index.php?topic=2824.0

but i must admit its a very addictive game and with BlinkOk gfx's would be a must play
anyway good luck with this one

mick :)
Title: Re: My second game: Hell Eagle
Post by: BlinkOk on August 21, 2012, 05:35:31 AM
did some more on the gfx and animnation. i tried to upload it to swfcabin but it display's it really tiny.
i guess i'll have to add guns to the taxi withh all these obstacles. (right click/view to see it full size)

i thought you could pick up the chicks and that little colour balloon would follow the taxi so you
know how many you are carrying and where you have to go to drop them off.

(http://s1-01.twitpicproxy.com/photos/full/641695594.png)

found somewhere to host it; (click on "play flash full screen" down the bottom right)
http://megaswf.com/serve/2465671 (http://megaswf.com/serve/2465671)

you can drive the car with the arrow keys
Title: Re: My second game: Hell Eagle
Post by: micky4fun on August 21, 2012, 06:44:45 AM
Hi all

yep BlinkOk , looks and plays superb , very nice indeed

mick :)
Title: Re: My second game: Hell Eagle
Post by: Sigtrygg on August 21, 2012, 01:05:26 PM
Hello BlinkOK!

Your idea and your graphics are very funny and I would like to integrate it into Hell Eagle.
Isn't it possible to replace men-animation with the chicks and eagle with the taxi and
the backdrop too? Can't you save it as an bitmap or png? I would to renounce of animted
canons.
In my game the world consist of a png-file with 4096x3072 pixels, the men-animation
consist of 4 positions. The canons are spites and have to position into the world and
the landingplatforms are just rectangles and touching the platform is detected by
RectHitSpritePixels.
So I just need a graphic as world, where you can fly through (the platforms may painted
direct into picture), a picture of taxi, an animation-Pic with the moving-positions like the
men-animation, a picture of the canons and their bullets and I would try to implement
the graphics in the game. If this work we can implement some elements like fueling furher.
How do you think about it?
Maybe there come more ideas from the comunity...

Sigtrygg

Title: Re: My second game: Hell Eagle
Post by: BlinkOk on August 22, 2012, 05:58:47 PM
Sigtrygg dude. I don't think it's a matter of just putting the graphics into the game and it's done.
to start with the controls for the taxi are different.
you will also want to add parallax (believe me you will love the effect)
there is also the matter of picking up and dropping off the chicks.
the cannon and all the other animations will add to the experience
i know it will be a bit of work but there is no deadline so you can take as long as you want
and i'm sure everyone here will help with any problems you may run into.
in the end i think you will have a very nice, polished game that is a showcase
of your programming skills.
Title: Re: My second game: Hell Eagle
Post by: micky4fun on August 22, 2012, 06:41:59 PM
Hi all

Quotein the end i think you will have a very nice, polished game that is a showcase
i very much think so to

mick :)
Title: Re: My second game: Hell Eagle
Post by: Sigtrygg on August 23, 2012, 01:18:28 PM
Hello Community!

Thank you BlinkOk and Micky4fun for replies.
I think I have to learn a lot more than I know.
I don't know what parallax means and I think
I have to get closer with maps. I couldn't make a
level editor like Mick. So I think I have to get
a lot of input.
At the moment I work at a programm that give
out all combinations of letters in a word (Anagram)
I will publish it when I am ready.
Until then!  :)

Sigtrygg
Title: Re: My second game: Hell Eagle
Post by: micky4fun on August 23, 2012, 05:38:42 PM
Hi all

Hi Sigtrygg

Thats a shame , your game is a nice addictive and must have another go game , no many of those around i know ,
always come back to it when you learn a little more ,but i dont think you are far away thats for sure
but its nice just to go at you own pace , i hope you get as much frustration , sorry fun as i do out of programming
parallex means , you have a layer on images , from front to back and they move at differant speed to each other to give depth to game
demo video here
http://www.youtube.com/watch?v=m1_dQ9ev77c


this has about 5 layers , but you would proberly only need 2 , forground and background
anyway good luck with all your projects and dont think it will take you long to suss this game out

mick :)
Title: Re: My second game: Hell Eagle
Post by: kevin on August 24, 2012, 01:27:31 AM
Sigtrygg,

  The parallax thing is as Mick suggests,  just drawing multi layers of the scene.  There's a number of methods, none of which are terribly complicated.  The concept is to give the 2d scene the appearance of depth.     For side scrolling games, we often have the 'game play' layer and a distant backdrop layer, like a mountain range, star field or something.    Assuming we're using a camera to view the game play layer, which is moving at 3->5 pixels left or right as the player moves left/right (Shadow of the beast style),  then our far off in the distance mountain range position is calculated as say a 10% of the players position.   Since the backdrops are generally tiled, we're just wrapping it to the cameras viewport.


   There's a number of threads on the subject spread across the forums.   One of the oldest that comes to mind, would be Xenon and Missile Attack demos, which are  the first or second real game demos written in PlayBASIC back in 2003.. Yep.  more useless trivia! :)


     (these are in on particular order)

   * Parallax Mountain Range In Triangles  (http://www.underwaredesign.com/forums/index.php?topic=3900.0)
   * Perspective Parallax (clever coders challenge #18)  (http://www.underwaredesign.com/forums/index.php?topic=3158.0)
   * Tree Parallax (http://www.underwaredesign.com/forums/index.php?topic=3695.0)
   * 8 Way Layered Star Field / Asteroids Style (http://www.underwaredesign.com/forums/index.php?topic=3837.0)
   * Shadow Of The Beast demo (http://www.underwaredesign.com/forums/index.php?topic=1438.0)
   * Thesius XIII - Forest Blast Tech (http://www.underwaredesign.com/forums/index.php?topic=1896.0)
   * Xenon PlayBASIC Tech Demo (http://www.underwaredesign.com/forums/index.php?topic=165.0)
   * 2D Platformer Revisited - Parallax Version (http://www.underwaredesign.com/forums/index.php?topic=2906.0)
   * Missile Attack (http://www.underwaredesign.com/forums/index.php?topic=112.0)
   * Missile Attack Update (http://www.underwaredesign.com/forums/index.php?topic=498.0)


 
Title: Re: My second game: Hell Eagle
Post by: Sigtrygg on August 24, 2012, 02:02:47 PM
Hello Mick4fun and Kevin!

Thank you Mick for explanation what parallax means.
Now I know it!  :)
Indeed games look much more living with using parallaxing.
Thank you Kevin for your help and the links. I will have a
look on them!
It's great that I am not alone with PlayBasic!  ;)

I have made an anagram-program which uses a database
of permutations. I took each letter in the word and assigned
it with one specific number in permutation-order.
It is possible to get out the words to a text-file.
It is not very exiting and you can find better anagram-programs
in internet, but maybe the source code is interesting for beginners.

Greetings

Sigtrygg
Title: Re: My second game: Hell Eagle
Post by: kevin on August 24, 2012, 05:03:15 PM
Sigtrygg

 Thanks for posting your new code, but it'd probably be of more use to people, if you just made a new thread for it and posted it over in the Source Code (http://www.underwaredesign.com/forums/index.php?board=12.0) forum.   After all, that's what it's there for.

Title: Re: My second game: Hell Eagle
Post by: Sigtrygg on September 23, 2012, 02:12:11 PM
Hello all!

At the moment I create two new levels for HellEagle and I used some ideas
from Kevins great HellEagle-MockUp. Espacially controlling the men was solved
very comfortably by Kevin. It saves a lot of code and made it easier to create
new men in new levels. I didn't take over everything from the mock-up. I saved
the coordinates of men, canons and platfomrs into a database instead of a text-file.
Of course it isn't as comfortable and extensive as in the mock-up, but it is now much
easier and faster to create new levels.
In that version I will publish HellEagle works still with worldmap as a sprite, but I try to
publish another version using maps and map-collision. I am courious if there will
be a gain in speed.
Until soon! Have a nice week!

Sigtrygg
Title: Re: My second game: Hell Eagle
Post by: kevin on September 24, 2012, 01:26:37 AM
 
  it'll run much faster as map.   The original game was running around 70-80 fps on my system, compared to 190-200 fps in the mock up.
   
Title: Re: My second game: Hell Eagle
Post by: Sigtrygg on October 01, 2012, 01:12:38 PM
Hello Community!

Here is HellEagle Version 1.5 !!  :)
I have created it in two versions.
In the first version the world consist of a sprite and
the collisions are sprite collisions. I made exe with
PlayBasic N2.
In the second version the gameworld is a map and
I used the new collision functions between map and
sprites.
I couldn't make an exe, because I used PlayBasic
Version N2 beta#3b for the map-version and the exe
didn't work. But you can get the source code.
Please tell me, which version runs faster/better than
the other and if you find any bugs in the game.
I didn't remark any differences in speed and scrolling
between the two versions. Both versions run with
120 fps.
I am looking forward for your remarks.

Special thanks to Kevin for his great mockup. It was/is very
helpful and I overtook some functions for my game,
e.g. handling collecting the men

Sigtrygg

downloadlinks
SpriteVersion :http://rghost.net/40685450 (http://rghost.net/40685450)
MapVersion: http://rghost.net/40685740 (http://rghost.net/40685740)

Title: Re: My second game: Hell Eagle
Post by: ATLUS on October 01, 2012, 01:33:27 PM
good job - Sigtrygg!
Title: Re: My second game: Hell Eagle
Post by: micky4fun on October 01, 2012, 02:27:40 PM
Hi all

Nice work Sigtrygg , good level design and addictive play , well think i will chill out playing this for the rest of the night

mick :)
Title: Re: My second game: Hell Eagle
Post by: BlinkOk on October 01, 2012, 05:44:41 PM
hey sigtrygg dude. it looks pretty cool. good fun.
the mapversion crashed on my PC after the splash screen. maybe because i'm not using the beta compiler
Title: Re: My second game: Hell Eagle
Post by: Sigtrygg on October 02, 2012, 02:40:44 PM
Thank you Mick, Atlus and BlinkOK for response to my game.
Yes, you need the beta version for running the map-version,
because it uses the new SpriteHitMapPixels function.

It is very easy now to create new levels, so maybe I will
do some more in future.

Is there anybody who knows why I can't use the icon for
hell eagle for the exe-file? The IDE shows the icon but in
the exe-file it don't appear.

And what about the tile animation comparing to framesheet-
anims? Where are the advantages and disadvantages?
Maybe it is a topic for the "Beginner"-heading?

Greetings

Sigtrygg
Title: Re: My second game: Hell Eagle
Post by: Big C. on October 04, 2012, 01:23:13 AM
hello to all

both version starts with black blank fullscreen and then crashes...

this ist the error...

Quote
Problemsignatur:
  Problemereignisname:   APPCRASH
  Anwendungsname:   PlayBasic.exe
  Anwendungsversion:   0.0.0.0
  Anwendungszeitstempel:   4ac6a46f
  Fehlermodulname:   nvd3dum.dll
  Fehlermodulversion:   9.18.13.623
  Fehlermodulzeitstempel:   503f77ed
  Ausnahmecode:   c000008e
  Ausnahmeoffset:   005e62f2
  Betriebsystemversion:   6.1.7601.2.1.0.256.48
  Gebietsschema-ID:   1031
  Zusatzinformation 1:   0a9e
  Zusatzinformation 2:   0a9e372d3b4ad19135b953a78882e789
  Zusatzinformation 3:   0a9e
  Zusatzinformation 4:   0a9e372d3b4ad19135b953a78882e789

I think its a graphiccards thing... but who knows...

Using latest PB-Beta (1.64N3 Beta 10) on Win 7 64bit with latest nvidia driver 306.23
Title: Re: My second game: Hell Eagle
Post by: kevin on October 04, 2012, 08:19:44 AM

  When the program starts it's loading media (which will be the displays current pixel format), only to then call Open Screen after it's loaded.   Given the media will be in 32bit pixel format if the desk top is 32bit, when it's changed to 16bit full screen exclusive, there's no telling whats going to happen really.     

  In terms of performance the map version (both running uncapped) is approaching twice as quick as the image version on my system, but there no surprises there.  It's doing less work and the graphics memory is sequential.   Given the size of the image, running pixel level impacts upon  it makes it bit crash happy also.  Older versions do the same thing.   I suspect there's some type of precision overflow, just like the old sprite map to routines. 


Title: Re: My second game: Hell Eagle
Post by: BlinkOk on November 09, 2012, 04:22:00 PM
check it out!
http://www.youtube.com/watch?v=zi8F3zo29pE (http://www.youtube.com/watch?v=zi8F3zo29pE)
Title: Re: My second game: Hell Eagle
Post by: micky4fun on November 09, 2012, 04:54:08 PM
Quotecheck it out!

great fun game , will chill out for a while playing this i think

mick :)
Title: Re: My second game: Hell Eagle
Post by: Sigtrygg on November 10, 2012, 02:47:41 AM
It seems to be a funny game and I like the graphics,
but it is a bit too restless for me according zooming
in and zooming out.
Does anybody know which programming-language was
used for that game?

Bye

Sigtrygg
Title: Re: My second game: Hell Eagle
Post by: BlinkOk on November 10, 2012, 03:01:22 AM
QuoteDoes anybody know which programming-language was used for that game?
it's html5