house hunter - Treasure Trove (wip)

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

Previous topic - Next topic

micky4fun

#30
hi all

QuoteWhy not make the make reveal a downward pan ?  the foreground stuff (text tidbits) could fade in.  
yes sounds good idea , i take it i could load all the map gfx's up then just scroll the map into posistion for each level , i will have to look at maps and cameras , the only problem is i have the jems as sprites will these scroll with the map using the camera command

anyway this is what i have done so far a 2 level demo , with just 2 creatures so far , i have a few more , but anymore whould be handy
also any map gfx's would be good as well as any other ideas/gfx's
there is no sound as yet and a few timing issues , just got to get the levels hardness right
ok controls are arrow keys and spacebar to backtrack

will put up code soon as i get it a abit tidy
mick ;)

see my next post

kevin

#31
Quoteyes sounds good idea , i take it i could load all the map gfx's up then just scroll the map into posistion for each level , i will have to look at maps and cameras , the only problem is i have the jems as sprites will these scroll with the map using the camera command

If you'd used a camera, all it'd take is a reposition of camera on the y axis.    The current one looks ok though, just feels odd.


 Played the demo,  it all feels pretty good.   Only bug bear in this version would be the up/down movement.  The current solution works, but if you're a few pixels off the opening, then valuable time is lost in alignment.  I suspect there's an easy fix though,  as the player is pressing down (or up), but the drill head is not quite in the right position,  then in those situations the head moves towards the opening (left or right).. Which would make the navigation feel that little more seamless.  

 For the levels, you really should look into making them external.   Then the community can help make them, play test them.. etc


buggage

The demo plays nicely, but yeah the up and down controls aren't perfect and don't always work when you need them to. I presume your code is checking for LEFT/RIGHT first and implementing those over UP/DOWN. The time limit is a bit tight too, I lost more games due to lack of time than through colliding with the critters. I still made it to Level 2 though. I would speed up the pipe retract too.

micky4fun

hi all

yep ok guys , first of all i was thinking of making it harder as i can do levels with 10 -18 seconds to spare ,
but i think i am used to it play testing all day all about the timing of moves , lol

yep the controls on this was always a sticking point , as i did say to BlinkOk in an e-mail i was not happy with them.
as it is at the moment , if going left or right you must stop pressing left or right to press up or down , otherwise you will continue left or right , the map is made up of 20x20 pixel blocks and the pipe moves 5 pixels a time but times 4 , so it moves more smoothly but a full 20 pixels before direction can be changed , but if you press left of right and stop over a gap , you will be either dead over the gap or 20 pixels either side of it , nowhere in between , maybe someone can make this better at some point ,

yep i can make the pipe retract quicker thats no problem

as for external levels , well someone may be how to make a loader as all the level maps are in data statements and pickup sprites are pre laid in for next loops depending on levels , the 2 demo levels are the same , but later ones will be in different places

ok ile get some sound and tidy up in code and label some of it so people will know whats happening were and maybe someone can make it controls a bit better

mick :)

micky4fun

#34
hi all

thanks for comments , here is my source code for game , ive tidy it up a bit , the main control is in the move pipe sub routeen , if anyone can improve this , all well and good , good luck lol , there must be a better way than i did it

mick :)

4 level demo a few post below

micky4fun

#35
hi all

erm . think what ile do is over this weekend concetrate on making the pipe control better than what it is , before doing anymore levels , animations and sounds , they are straight forward ,
also if anyone has a better title screen or better name for game maybe?
hoping this wont take to long now to complete as i have other games to get going and eager to start on the next one

anyway lets see what i can do over this weekend , heres my topscore so far

mick ;D

kevin


Quoteerm . think what ile do is over this weekend concetrate on making the pipe control better than what it is

      Taking a bit a night off Dtab stuff and been having a tinker with a few ideas externally.  Been giving the corner turning idea a bit of go (what i mentioned above) and it seems to work, but it doesn't look at solid at time.   Like If you move past an opening and then press down say, it'll back up and go down.  When this occurs at speed it looks a bit shakey.      Got a few other tweak ideas if that doesn't pan out.   


      Only got around to having a look at your code before, I really can't stress enough that it's time to learn about functions.    A function is like user made command.  They're subroutines that are protected from variable collisions.  They're mainly useful in cutting down the amount of repeated code.  For example, you can pull the level initialization code inside a function.  The function can be called any time to set up the level, rather than inserting the same fragments of code over and over...which is error prone.     The beauty of wrapping your code up inside functions, then something goes wrong in your program it's easy to fix or change.  Since the code only appears in the program once, the program becomes more flexible and resilient to change.   

       Some examples.



          ; so draw the score and time
DrawNumber(24,60,digits$(score,6))
DrawNumber(687,60,digits$(time,2))

  ; user defined psub
Psub DrawNumber(Xpos,Ypos,T$)
For lp=0 to len(t$)-1
ThisCHr=mid(t$,lp+1)-asc("0")
      drawimage 200+ThisChr,Xpos,Ypos,1
Xpos+=22
next
EndPsub


     While this is more robust method,  I'd actually suggest converting the bitmap font stuff into a real compressed raster fonts (search for SaveFont on the boards).  Which would get rid a bunch of setup code and allow you to draw bitmap style fonts with the print and text commands.
   



   ; example level set up

  MyMap=1
  CreateMap MyMap,1
  MyLevel=1
  CreateLevel Mymap,MyLevel, 39,80
  MakeMapGFX MyMAP,40,20,20,8,rgb(0,0,0),2

    ; call the custom function to do the job
      ReadGameLevel(MyMap,MyLevel)


; function to read the tiles into the level
Function ReadGameLevel(Map,Level)
   For Ylp=0 to 29
For Xlp=0 to 39
PokeLevelTile   map,Level,Xlp,Ylp,ReadData()
   next
   next
EndFunction




    Stuff line the sprite routines, could be culled down into a common set of simpler functions.   So the custom functions are at higher level (do a bunch of stuff inside them).  Meaning you write less code to set up stuff.   

    ; Ie some stuff like this

  info=getfreesprite()
  createsprite info
  spriteimage info,300
  centerspritehandle info
  positionsprite info,400,265

  level_complete=getfreesprite()
  createsprite level_complete
  spriteimage level_complete,310
  centerspritehandle level_complete
  positionsprite level_complete,400,-100
  spritedrawmode level_complete,4
  SpriteAlphaLevel level_complete,0.95




 
info                 =MakeSprite(400,265,200)

Level_Complete =MakeSprite(400,-100,310)
        spritedrawmode level_complete,4
        SpriteAlphaLevel level_complete,0.95
 
Function MakeSprite(Xpos,Ypos,IMage)
Sprite=NewSprite(xpos,Ypos,image)
centerspritehandle sprite
EndFunction Sprite 
 




Quote, before doing anymore levels , animations and sounds , they are straight forward ,also if anyone has a better title screen or better name for game maybe?

     I don't mind the title, although I wonder if there's another game out there with the same name ?   Might be worth a google on that one.     


Quotehoping this wont take to long now to complete as i have other games to get going and eager to start on the next one

     Know the feeling :) 

kevin

#37
 Turned the map movement thing into another source code example.  It's posted it over here 4 Way Map Movement (Moving through tunnels)


 To convert the numbers into a custom font, you need something like this.


// the location where the numbers are stored
path$="D\MicksGame\Treasure Trove_SRC\"

// location tp save the font
savefile$="d:\NumberFont.crf"

Image=loadnewimage(path$+"0001.png")

ChrWidth =GetIMageWidth(image)
ChrHeight=GetIMageHeight(image)
CreateBitmapFont 10,ChrWidth,ChrHeight,4

cls $442288

Zeros$=""
for lp=asc("0") to asc("9")
file$=path$+zeros$+chr$(lp)+".png"
Thisframe=loadnewfximage(file$)

rgbmaskimage Thisframe,$00ffffff
// Grab this frame into the font
rendertoimage ThisFrame
getfontchr 10,lp,0,0
rendertoscreen
Zeros$="000"
deleteimage ThisFrame
next

savefont savefile$,10

print "Done"
setfont 10
fontdrawmode 10,1
ink argb(255,255,255,255)
print "0123456789"

Sync
waitkey



    So once the font is made, we load and use it like so.




loadFont "NumberFont.crf",10

setfont 10

cls 255

Print "0123456789"

Sync
waitkey







micky4fun

#38
hi all

thanks kevin for the code snippets , yes i think i need to start and do some function routeens for my simple games ,
well spent the last 2 days trying to make the players movement work better , but none seem to work correctly , so really 2 days wasted , nevermind , as the control sysyem is not ideal , i dont think i will wast anymore time on trying to better it
as the contols are far from ideal , all i am going to do now is add another level gfx's and make 3 levels for each of the 3 different gfx's i have so 9 levels in all , if player manages to get past all 9 levels then just start over again

its just i have other games i want to try and to wast time on this game thats not right seems silly
heres the 3rd gfx's that i will use
i will now put it all together and put in sounds etc and post soon

mick :)

kevin


Don't worry all is not lost, If I had more time i'd have crack at tweaking your movement,  however you could also try converting the collision areas into collision worlds.    Convert Map To Collision Worlds    
 

micky4fun

hi all

QuoteDon't worry all is not lost, If I had more time i'd have crack at tweaking your movement
yep i still going to carry on , aint had much time last few days , but this morning i have added a new level 3 , level 4 demo now below with it now being a little easier , some sound added but not complete and sounds may change , also a quicker pipe retract
when finished i will spend a liitle time on another idea with controlls , its only a simple game so not work me spending to long on it..

mick :)

kevin


so any progress or ya ditched this one ?

micky4fun

hi all

well did spend a little more time trying to make the controll system better , but pretty much played the same , so for that reason i could not get that more excited about doing any more to this game but did have fun doing what i did so far , as i have been busy at work over the last week and will be this week to , but next week sould be back to normal so i hope to get another project off the ground , got quite a few to choose from so better luck next time
anyway thanks for trying to help me Kevin , but i really think you are right i must start using the function command more , i will really try to get this into practice..

mick  :)

kevin


Have you got all the artwork for this one ? 

micky4fun

hi all

QuoteHave you got all the artwork for this one ? 
well this is pretty much it all art i have done so far

mick :)