News:

Function Finder  Find all the functions within source code files

Main Menu

house hunter - Treasure Trove (wip)

Started by micky4fun, May 08, 2011, 06:01:28 PM

Previous topic - Next topic

kevin

#15
Quotethe levels are done as follows with maps and a loaded gfx file, the pick ups are sprites with just a few for next loops to put them in place
example

   Yeah it all looks good,  just wanted to make sure you're not hard coding the levels into the program.  This is one of those games that benefit from having clear division between the game engine and data.    So the game engine should be able to load and play any level it's presented with. Providing the level makes sense.    

   The level data can represented a million ways, but one stumbling block people seem to the run into, is how to go about externalizing  character data.  The hard way, is having each character and all of it's properties stored in the level structure with the map data etc.   The issue with this, is that small changes the game engine will break the data.  So abstraction is better.

   A better way is to use a type of entity interface.     So the level stores the bare minimum data for each character,  basically it's position and type.     So the level loader reads the entity data and takes this info and calls the 'create character' of this type.  So the game engine fills all the little nitty gritty about the character..  

   For example,  if character entitiy could just be  a text file.   Each entity would have an ID/NAME whatever, which is then followed by it's  variables.  



[PlayerStart]
   Pos = 100,200


[Dragon]
   Pos = 1000,22

[Car]
   Pos = 200,100
   Colour = $0000ff

[Car]
   Pos = 220,100
   Colour = $ff0000




  So to load the level we read the text from disc, then run through it line by line scanning for tokens.  When a token is found it, it collects the properties of and calls the create object to add this character to the scene.    Pretty much everything can be done like this.  


 Entity Example (Loading Game Levels)


micky4fun

#16
hi all

yep thanks kevin for the example , i will bare this in mind for any other games like this , my stiing up is pretty simple for the level i am going to have

ive been busy looking for any other new houses i can use at top of screen for other levels , otherwise will always be the same houses , but i have not had much luck so far , but still looking , anyway its coming along quite nice now , will try and get a demo up soon , going to title screen sorted out over weekend hopefully and next level linked , see how it goes time wise
but here is what it looks like in action , you cannot cross over your drilling pipe otherwise it will break off and lose a life , when bugs/creatures  touch your drilling pipe it will glow red to warn you , and you can then recoil your pipe to try and kill then , but you have a limited time to do this , also level must be completedin a certain time ,

top left shows score , top right level time left and bottom middle damage to pipe done by bus/creatures , when this runs out you lose the current pipe
ok back soon with an update

mick :)
http://www.youtube.com/watch?v=-HL_TldIUFs


Edit: added youtube tags.

kevin


  Looks great mick,  would love to put this on UW.com when you're done.  So um.. hurry up :)


   

buggage

That's impressive. :)

How are you storing the pipe - in an array of some sort?

micky4fun

#19
hi all

QuoteLooks great mick,  would love to put this on UW.com when you're done.  So um.. hurry up
well going as fast as i can , getting gfx's is the main hold up , but slowly getting some kinda title screen ,
think you will have to see how it plays , seems ok to me

QuoteThat's impressive.
yep thanks buggage ,
QuoteHow are you storing the pipe - in an array of some sort?
well i tried about 5 differant ways to do pipe from using the poke and peek level tile to what i am using now , im using a list array using sprites for it at the moment as i wanted it to fall of the screen once it was dead either touching itself or bugs killing it , i dare say there is an easier way that someone will show us when i put the full code up , it wont be that hard to change it to something else
soon as i get title screen and level one and two linked ile post a download demo

mick :)

kevin

#20
Quotewell going as fast as i can , getting gfx's is the main hold up , but slowly getting some kinda title screen ,
think you will have to see how it plays , seems ok to me

  I'm in no hurry..


Quotewell i tried about 5 different ways to do pipe from using the poke and peek level tile to what i am using now , im using a list array using sprites for it at the moment as i wanted it to fall of the screen once it was dead either touching itself or bugs killing it

  So each 'block' in the pipe is becoming a sprite ?  or it's stretching a sprite along each the axis when a change if direction occurs.      In nut shell, the more sprites you have in the scene the more nested collisions checks required to resolve it.   There's a section in the optimizing tutorial called spatial partitioning (At bottom) which covers resolving nested collisions.

  However, I think you could use sprites to draw the pipe, but use rectangles to check for collisions.   So the collision pipe is stored as list of movements from one point to the next.  The collision checker, uses this length of each movement (from start to end point) to create a rect that represents this row (or column) of sprites and does a check upon that.  Which might remove a lot of the nested recursion.  But that's only speculation at this point.

  Tron uses a similar system to detect overlaps in the trail.



buggage

Rather than using the sprites for collision testing, I would use an array to store each pipe piece's position (as well as another array for all the bonus items). Then only do checking against this array with the creatures - the first pipe piece could then check for collisions with the bonus items (even they could be part of an array). This method would be much faster than sprite to sprite collisions and just as effective.

However whatever you're doing now seems to be working nicely :)

BlinkOk

i agree with buggage. everything else seem like over kill

micky4fun

#23
hi all

yep guys thanks for the suggestions , if game turns out ok , then anyone can step in and adjust it if they want thats no problem , as i thought there must be an easier way to do it,
as im not that great on the programming side , as i said i have the pipe a a linked list using sprites and these sprites are small only 12x12 pixels
the head of the pipe is a sprite too , but slightly bigger, to collision test im using the slugs to see what they hit and if its the pipe then pipe turns red
if its the drill part they die , and another array to see if the pipe hits hitself , just testing the array to see if it overlaps , so no sprite collision testing going on at all there. at the moment im getting 300-400 fps on my pc and 180-220 fps on laptop so no problems with speed with a mid range pc

well spent one and a half days just trying to get a title screen , crazy aint it , anyway i have to move on , so i have settled for this , yep 1 and a half days for this , can come back to this later if needed.

so now will get the levels linked and add more levels to it , ile post back as soon as i get 2 levels linked with a demo
thanks guys
mick :)

Watch On YouTube



buggage

:)

Do you have a "quick return" option yet? This makes the pipe quickly retreat back to the start and is invaluable for helping to avoid/reduce pipe damage.

micky4fun

hi all

QuoteDo you have a "quick return" option yet? This makes the pipe quickly retreat back to the start and is invaluable for helping to avoid/reduce pipe damage.
yep thanks buggage , the controls are directions with arrow keys , you can back track this way , but the spacebar does a quicker return of the pipe

mick :)

BlinkOk

very nice mick. the transition is perfect. i think i would use a font with a thicker line, it kind of gets lost in the sky. some fonts i like are;
ardvark
adlib
badaboom
bd cartoon shout
bigfish<--- my fav

buggage

All those fonts are nice, but...

The Ardvark font would be coincidentally appropriate, seeing as this game is based on Oil's Well, which was based on the game AntEater, which stars... an Aardvark!



;D

micky4fun

#28
hi all

right thanks buggage and BlinkOk ,

im using paint.net , did not realize it uses the windows fonts as its fonts , thought i was just stuck with those that i had
just been to a font web page , well could spend hours there , but not got time a moment.
i have now changed title screen font , but still not happy with it but as i said it will do
just finished level link ups , just got to do starting link with a 3 2 1 count in and then the end of game gfx's
then all to do is the rest of levels layouts and some other gfx's for them
as soon as i do start 3 2 1 in , and end of game ile post a 2 level demo

mick ;)

kevin


Why not make the make reveal a downward pan ?  the foreground stuff (text tidbits) could fade in.