Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 A neat looking "fountain"
Index -> Programming, Turing -> Turing Submissions
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
petree08




PostPosted: Tue Sep 04, 2007 12:56 pm   Post subject: A neat looking "fountain"

i use the word "fountain" cuz i cant describe it any other way

click on the mouse to shoot "water"

you can change the angle it is being shot out with the arrow keys

now that school is back i have steady internet access and i have sum neat stuff i made over the summer to show. lol

have fun Canada Very Happy Canada

code:

const NUM_OF_OBS := 400
const G := .32 % gravity
const FORCE := 10 % the force given to the object when launched
% change these consts to change the colors of the
%projectiles
const C1 := 9
const C2 := 54

var XM, YM, Click : int
var XW, YW, VY, VX : array 1 .. NUM_OF_OBS of real4

var Angle : real4
var Key : array char of boolean
var Clicked : boolean
var DropNum, FireCount : nat
var Water : real4
Water := 1
Angle := 0

for W : 1 .. NUM_OF_OBS
    XW (W) := -10
    YW (W) := -10
    VY (W) := 0
    VX (W) := 0


end for

Clicked := false
setscreen ("graphics:max,max,nobuttonbar,offscreenonly")


DropNum := 1
FireCount := 1
colorback (7)
loop

    cls
    Input.KeyDown (Key)
    mousewhere (XM, YM, Click)



    if Key (KEY_RIGHT_ARROW) then
        Angle := Angle + 1
    elsif
            Key (KEY_LEFT_ARROW) then
        Angle := Angle - 1
    end if
    if Angle > 360 then
        Angle := 0
    elsif Angle < 0 then
        Angle := 360
    end if

    if Click = 1 /*and Clicked = false */ then


        XW (DropNum) := XM
        YW (DropNum) := YM

        VY (DropNum) := round (sind (Angle) * FORCE)
        VX (DropNum) := round (cosd (Angle) * FORCE)
        FireCount := 0
        if DropNum < NUM_OF_OBS then
            DropNum := DropNum + 1
        else
            DropNum := 1
        end if
        Clicked := true

    end if




    for W : 1 .. NUM_OF_OBS

        drawline (round (XW (W) - (VX (W) * 2)),
            round (YW (W) - (VY (W) * 2)),
            round (XW (W)), round (YW (W)), C1)


        XW (W) := XW (W) + VX (W)
        YW (W) := YW (W) + VY (W)
        VY (W) := VY (W) - G
        if YW (W) < 1 then


            VY (W) := - (VY (W) / 1.25)
        end if
        if XW (W) > maxx or XW (W) < 1 then
            VX (W) := -VX (W)
        end if
        drawline (round (XW (W) - (VX (W) * 2)),
            round (YW (W) - (VY (W) * 2)),
            round (XW (W)), round (YW (W)), C2)

    end for

    if Click = 0 then
        Clicked := false
    end if


    drawline (XM, YM, XM + round (cosd (Angle) * 15),
        YM + round (sind (Angle) * 15), 12)
    drawfilloval (XM, YM, 5, 5, 12)


    put DropNum
    View.Update
end loop

Sponsor
Sponsor
Sponsor
sponsor
cavetroll




PostPosted: Tue Sep 04, 2007 3:27 pm   Post subject: RE:A neat looking "fountain"

Cool program. It's got some neat effects.

Good work
darkangel




PostPosted: Mon Sep 17, 2007 12:58 pm   Post subject: Re: A neat looking "fountain"

very cool, i could sooooo see this being a good game.

hmmmm, the cogs in my brain are turning.
cpu_hacker4.0




PostPosted: Fri Oct 05, 2007 9:03 pm   Post subject: Re: A neat looking "fountain"

good job thats amazing!
Feorn




PostPosted: Sat Oct 13, 2007 9:19 pm   Post subject: Re: A neat looking "fountain"

I have to say this is a really cool program I have spent about 30 mins just changing some things in this program like changing it's color and its gravity, it's a really fun program I recomend people try this out and its an easy way to learn also. Smile
sam21292




PostPosted: Sat Dec 29, 2007 7:30 pm   Post subject: RE:A neat looking "fountain"

This is a really good program, and Feorn must be flipping his mouse just by looking at it
Nyrd




PostPosted: Sun Feb 10, 2008 10:28 pm   Post subject: RE:A neat looking "fountain"

That's some bouncy water you got there . . . Razz
syntax_error




PostPosted: Mon Feb 11, 2008 5:00 am   Post subject: Re: A neat looking "fountain"

Nyrd wrote:

That's some bouncy water you got there . . . P


don't just start up a 2ish month old thread and just say that; please read over forum rules, over again.
Sponsor
Sponsor
Sponsor
sponsor
Nyrd




PostPosted: Mon Feb 11, 2008 12:05 pm   Post subject: Re: A neat looking "fountain"

vSorryy! For some reason I didn't notice the date ... : Embarassed
DaveAngus




PostPosted: Tue Mar 18, 2008 9:16 am   Post subject: RE:A neat looking "fountain"

I really like this.
I think that we may use this in our class as a little assignment
Doug101




PostPosted: Tue Apr 01, 2008 10:44 am   Post subject: Re: A neat looking "fountain"

sweet game i loved it it coll how you can simulate gravity.
Tallguy




PostPosted: Tue Apr 15, 2008 9:53 am   Post subject: RE:A neat looking "fountain"

that is really cool, it has really good reaction time and the boudries work, very good
Serk91




PostPosted: Wed Apr 23, 2008 8:30 am   Post subject: RE:A neat looking "fountain"

siiiiick! awesonmme!
Prongs




PostPosted: Fri May 21, 2010 8:40 am   Post subject: Re: A neat looking "fountain"

That was so addictive. Wow.
Scott




PostPosted: Fri May 21, 2010 9:16 am   Post subject: Re: A neat looking "fountain"

Well thats addictive and fun.
I like it but I noticed when the "water" hits at a certain angle it loses its momentum? or bounce?
Just thought I'd mention.
Other then that its very good.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 17 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: