Welcome to Phrogram Sign in | Join | Help
in Search


Project problem

Last post 07-28-2008, 1:48 PM by TomDad. 13 replies.
Sort Posts: Previous Next
  •  07-07-2008, 12:05 PM 6845

    Project problem

    I saw this post and thought maybe I have a simlar problem...?

    http://phrogram.com/forums/thread/6837.aspx

     This is a project I'm working on - and things don't seem to be working
    right...

    Take a look at the code, the bomb does not seem to be falling exactly  at the bottom within the Phrogram window.

    It stops before where it should. At first thought it was the way I created the sprites, but at the moment not sure? I make the assumption that if all the sprites are pixel perfect in THEORY this should not happen? Beacuse if you look at the code it all should be "auto adjusting" based on spritewidth / height...screen width height etc. - I hope that makes sense...!

    Perhaps it is getting the height of the actual window box itself rather than what is contained in the inner window? It could be I just made the background sprite just too big and Phrogram is not going (in a good way) to make the whole window box go off the screen...thus making the "x off" box disappear? I tried it with one of Phrograms pre-loaded sprites 3.GIF and thought that was closer...but it still didn't reach exactly the bottom of the screen...

    If it is a coding issue then please DON'T tell me...!....I definately know how to make a "bodge" to overcome this...

    PS bit wary that there maybe a copyright issue beacuse I'm trying to replicate this game as close to the original, this is only a "prototype" so far to get the "feel" for the game...so I don't mind if this gets removed....


    TomDad. Tom is my son...and I'm his Dad. So we are TomDad Software.
  •  07-07-2008, 1:36 PM 6853 in reply to 6845

    Re: Project problem

    I'm not 100% sure what the problem is here. Is it that the bomb is not moving right down the screen but instead tracks the bomberman at the top?

    Or are you saying that at the point the bomb hits the 'bottom' and explodes the sprite itself is a few pixels up from the bottom of the screen?

     


    Managed DirectX and XNA ? Check out http://www.thezbuffer.com
  •  07-07-2008, 1:50 PM 6855 in reply to 6853

    Re: Project problem

    I'm trying to subtract the height of the bomb sprite - minus the width of the bottom of the screen. Based on the height of the background sprite. hence in a pixel perfect world it should just stop there.... 

    Ok I'm not quite in "code mode" tonight...I'll need suppose another machine to get this tested on and see the results...maybe work out the problem from there...will let you know if i think there is an issue somewhere!


    TomDad. Tom is my son...and I'm his Dad. So we are TomDad Software.
  •  07-07-2008, 2:03 PM 6857 in reply to 6855

    Re: Project problem

    OK, so my quick look suggests to me that the sprite is hitting the bottom of the screen even if you can't actually see it get there... hopefully thats enough of a hint ;-)


    Managed DirectX and XNA ? Check out http://www.thezbuffer.com
  •  07-07-2008, 2:24 PM 6859 in reply to 6857

    Re: Project problem

    Hmm...I determined not to be beaten...!....thought I was right 'cos of how everything did everything for itself in the way I coded. Watch this space as they say....!
    TomDad. Tom is my son...and I'm his Dad. So we are TomDad Software.
  •  07-08-2008, 10:50 AM 6869 in reply to 6859

    Re: Project problem

    Got it...the problem is;

    line 91 being + 10 .....and not lets say plus bombheight or plus 1...(think i was trying for "effect" there and make it look a bit "8 bit")

     and the sprites are not proportional either ( not evenly divisible) as they fall down the screen so need to do a bit of jiggery pokery with the orginal sprites to make that happen if I want code that way...or apply a "bodge" (which I know how to do).

    Thats what I worked out in my head in theory anyway...I'll apply that and see if it works...because I want the code to look as "clean" as possible if not the work around would.

    Thanks, I just though it was an issue with Phrogram (sorry) because the window had got too big on the screen! Couldn't possibly think it was a problem with me (ha ha)

     (Hope this isnt too hard to follow)

     

     

     


    TomDad. Tom is my son...and I'm his Dad. So we are TomDad Software.
  •  07-08-2008, 3:12 PM 6872 in reply to 6869

    Re: Project problem

    Attachment: Kaboom080708B.kpl

    I'm still unsure...forget about the last post for the meanwhile, I progressed the code very slightly, so attached the new Phrogram file only...and tried using the HideToolBar() thing at line 39. try REMing it out - you know using //

    Hmm...the bomb gets closer to the bottom of the screen with HideToolBar() but without it it is back to the norm.

    My assumption is that Phrogram would automatically account for the Tool Bar being there and things should still look the same, what I mean it should judge things only on the inner programmers territory window. After all thats is - as far as I know all they can touch? You probably know that I'm used to seeing things more in a non windows enviroment, i.e as is you see it on a full screen. So if that is the case then just say back to you...no hints please or solutions! I really do want to figure all this stuff out myself!


    TomDad. Tom is my son...and I'm his Dad. So we are TomDad Software.
  •  07-09-2008, 12:59 PM 6874 in reply to 6872

    Re: Project problem

    I had a look on your code. It has nothing to do with Phrogram or Windows or the ToolBar that the bomb don't reach the bottom . You don't wont hints or solutions ( I understand that ) but as a tip : Use Breackpoints and control the amounts of your variables at the moment your interested in. Also you can slow down your prorgam to see in slowmotion what happend. 

    Hope that helps

    Michael

  •  07-09-2008, 1:57 PM 6876 in reply to 6874

    Re: Project problem

    Thanks as usual Michael...

    I haven't used breakpoints really, although I know they were discussed before on the Phrogram website, I use Status() to get the values of the variables to get where things are and where things are going. In this case I have not yet done - but should of have...

    I was trying a way ...well maybe a bad way in some cases of coding slighly different to what I'm used to in Phrogram...making everything "auto size" and "auto adjust" for itself - was convinced from my logic that the problem was elsewhere.

    Suppose this is closed...it is over to me now to work out what is going on with my code - which is good!

    Suppose also some amateurs (especially!) and professional programmers (sometimes...or perhaps moreso..?) Just want to make you bash your head against the keyboard!

    Thanks Zman also of course - its been a struggle (with me thsat is!) but you guys have got their in the end!

     


    TomDad. Tom is my son...and I'm his Dad. So we are TomDad Software.
  •  07-09-2008, 2:25 PM 6879 in reply to 6876

    Re: Project problem

    using breakpoints to stop and inspect variables is a great way to debug apps - I use it ALL the time.

    If you dont want to break point every time round your loop, and since Phrogram doesn't have conditional breakpoints you can add some code like this.

    If (value > 1000) then
         Debug.Write("here")
    End if

    Then you an put the breakpoint on the Debug line and it will only break when value is over the limit you want


    Managed DirectX and XNA ? Check out http://www.thezbuffer.com
  •  07-09-2008, 3:20 PM 6880 in reply to 6879

    Re: Project problem

    Thanks, but this is stuff that I'm just not used too! SYNTAX ERROR? IN LINE 10 is all I'm used to! and TRON TROFF and watching those lines speed crazily down the screen with squared brackets...and having to use SHIFT @ to momentarily pause...

    Ok I should steer clear of those unknown 8 bit home computer references these days because loads of people on here may not understand unless you are at least 35 years old!

    But ok get hints that I should change the way majorly I should do things, after all I have to help teach my son this too - my bad habits are not getting to help!

    Everything on Phrogram is made simple, to the best it can be. I think I have found a more complex Pascal IDE (I know I know Pascal) but found some training videos that explain a bit more where I could understand and will move me on and then back here to make me better. (I hope)

     


    TomDad. Tom is my son...and I'm his Dad. So we are TomDad Software.
  •  07-10-2008, 10:13 AM 6881 in reply to 6880

    Re: Project problem

    Ok, its a big step from programming Basic in The 80th to a modern IDE. But debugging with breakpoints is straightforward. Trust me. I try to convince you.

    In your program at line:

       113    BombY = MadBomberY + MadBomberHeight

    ( maybe your linenumber is different [ the code is important ] ) klick left of the linenumber. A red point is seen and your code will get red too. Now run your program. The program stops at the point where the bomb gets to the bottom.

    Open the the Debug window (klick on it )

    You see youre aplicationclass as  +this

    Klick on the + to expand it. Thats all . Now you can see all your variables with their values.

    Remember that the program is still running. If you want to change something in your code you have to stop the program. But you also can continue running the program to see what happend next. When the program is stopped, one klick on the red point, and he's gone.

    Michael

  •  07-10-2008, 11:37 AM 6882 in reply to 6881

    Re: Project problem

    Thanks Michael for the help in this, I have heard of this in phrogram on a previous post...but didn't think it could do so much to make things better and easier!

    Thanks for the step by step guide that was really good...

    I followed that perfectly. Now need to just do that way of debugging in the future..

    I am convinced!


    TomDad. Tom is my son...and I'm his Dad. So we are TomDad Software.
  •  07-28-2008, 1:48 PM 6972 in reply to 6882

    Re: Project problem

    Not worked on this for a bit - and yes stil havent't solved the above problems...back on this now after the Autumn when have more time..I find this interesting because it is such a simple easy game to apply in Phogram!

    See you!


    TomDad. Tom is my son...and I'm his Dad. So we are TomDad Software.
View as RSS news feed in XML