Welcome to Phrogram Sign in | Join | Help


Re: ATOM Project

  •  09-27-2006, 10:22 AM

    Re: ATOM Project

    I got another error.

     

    But I’ve removed those lines so that we can try again. This time you will get my whole program, and you see the purple bulb covering the blue sprite, that is where I want the purple bulb to move away from me and against me, so it will go over the sprite and then under the sprite.

     

    What I was trying out was a piece of your code in “Bouncing balls” But your code told the sprite to go on random so it would have been wrong anyway.

    I just tried out one of my ideas, and that was to write:

    ScaleSprite”Electron”,-0.25) so I hope it would go further and further away from me, but instead it was turned up side down. :)

    But how can I make the scaling change while the program runs?

    And how you told me that I could make your sprite show in your program, didn’t help me in my program. Though I don’t quite understand what I was suppose to find in your program when I did those changes. Have you tried it your self? You only get to see something move very fast, and then after the text has been shown, you just see a sprite showing in the picture.

     

    You have also forgotten to tag your reply. And there was one more thing, but I've forgoten it. I hope it was not important. I remember: The image you added is what I've imagined, the only different was that I had in mind a more simple middle. But I have never seen anything that complicated before. So it means that we go for the complicated middle!!

     

    And the Norwegian: the direct translating would be “He who waits for something good, waits not in vain.” Though the most correct one is “He who waits patiently will be rewarded”

     

    Jeg er glad for at du kan forstå Engelsk. :D

     

    My program:

     

    Program NewProgram

     

      Define WindowWidth As Int = 1000

      Define WindowHeight As Int = ConvertToInt(WindowWidth *0.75)

      Define BackgroundColor As Int = white

     

       Method main()

        SetScreenSize ( WindowWidth, WindowHeight)

        Clear(BackgroundColor)

         

                SetDeviceCoordinates()

               

                LoadSprite("Electron", "Bulb_Blue_lighto.png")

                SetSpriteZIndex("Electron",0.10)

                MoveSpriteToPoint("Electron", WindowWidth/2.5, WindowHeight/1.9)

                ScaleSprite( "Electron",0.28)

                HideSprite("Electron")

               

                LoadSprite( "Atom","bulb_Green_lighto.png" )

                MoveSpriteToPoint( "Atom", WindowWidth/1,WindowHeight/1 )

                HideSprite("Atom")

               

                LoadSprite( "Dott","bulb_purple_lighto.png" )

                MoveSpriteToPoint( "Dott", WindowWidth/.5,WindowHeight/.5)

                HideSprite("Dott")

               

                LoadSprite( "YellowBulb", "Bulb_Yellow_lighto.png" )

                MoveSpriteToPoint( "YellowBulb",WindowWidth/2.5,WindowHeight/1.9)

                ShowSprite("YellowBulb")

     

                ScaleSprite( "electron",.25)

                ScaleSprite( "yellowBulb",0.25)

                ScaleSprite( "Dott",0.25)

                ScaleSprite( "Atom",0.25)

               

                SetSpriteZIndex("Electron",14)

                SetSpriteZIndex("atom",0.11)

                SetSpriteZIndex("Dott",0.10)

                SetSpriteZIndex("YellowBulb",0.13)

               

                            Define Slices As Int = 359

                            Define z As Int

                            Define X As Int  

                            Define Y As Int

                            Define radius As Int = 200

                            Define CenterX As Int = 400

                            Define CenterY As Int = 400

                            Define MovingX As Int = 400

                            Define MovingY As Int = 400

                            Define Radius1 As Int = 100

                            Define CentersX As Int = 200

                            Define centersY As Int = 400

                           

                      While True 

                 For z = 0 To Slices Step 1

                X = Radius+CentersX

                Y = Sin(DegreesToRadians(Z))*Radius+CentersY

                MoveSpriteToPoint("Dott", X, Y)

                StampSprite("Dott")

                 Next                  

     

                 For z = 0 To Slices Step 1

                X = Cos(DegreesToRadians(Z))*Radius+CenterX

                Y = Sin(DegreesToRadians(Z))*Radius+CenterY

                MoveSpriteToPoint("Electron", X, Y)

                StampSprite("Electron")

                 Next

               

                 For z=0 To Slices Step 1

                X = Cos(DegreesToRadians(Z))*Radius1+MovingX

                Y = Sin(DegreesToRadians(Z))*Radius1+MovingY

                MoveSpriteToPoint("Atom", X, Y)

                StampSprite("Atom")

                 Next

                End While

               

          End Method

     

            Method secondary()

                    Define Angle As Int

                    For Angle = 1 To 360 Step 15

                            PrintLine ( Sin ( DegreesToRadians ( Angle ) ))

                    Next

            End Method

     

            Function DegreesToRadians (Degree As Int) As Int

                    Define Pi As Decimal = 3.14159265

                    Return Degree * Pi /180

            End Function

               

    End Program


    Filed under:
View Complete Thread