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

Username:   Password: 
 RegisterRegister   
 Dodge The Larva (Starcraft Map) Turing Style. UPDATED!April1
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
the_short1




PostPosted: Tue Mar 30, 2004 8:57 pm   Post subject: Dodge The Larva (Starcraft Map) Turing Style. UPDATED!April1

its called Dodge The Starts.... Hope u enjoy....

MOVE WITH ARROW KEYS!!!!!
YOU ARE THE BLUE BOX!!!!!!!!
RED IS SAFE ZONE!!!!!!!!!!!!!!!
GREEN IS FINISH!!!!!!!!!!!!!!!!!

This game goes on forever untill u hit a star.... but each level adds 25 more stars... so... WATCH OUT!!!!~!

please tell me if You are moving REALY REALY slow... cuz if thats so.... ill have to change it.......cuz when u have 500 stars and u have to check if it hit u all the time... it makes it slow.... but... it could just be me...

NOTE: i have the slowest PC in the world... 120 MHZ!

NOTE: srry for the CAPS.... in firefox its giving me issues with underline and stuff... i cant just select and press the button... and i lazy..[/u]







!!!!!!! i removed the mass amounts of wasted time doing whatdotcolor for each star,... instead it checks if u hit a star.... lots less time... i shoulda done this from the start but i was kinda not paying atension... i was watching TV....

anyways... this version has a much more acurate collision...



Dodge The Stars.t
 Description:
UPDATED

Download
 Filename:  Dodge The Stars.t
 Filesize:  4.3 KB
 Downloaded:  480 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Delos




PostPosted: Tue Mar 30, 2004 9:44 pm   Post subject: (No subject)

Ah, your Brownian Motion finally payed off.

Nice.

+ bits.
jonos




PostPosted: Tue Mar 30, 2004 9:52 pm   Post subject: (No subject)

very good stuff, a lot of fun. -bits hehehe, no, sorry: +bits
the_short1




PostPosted: Tue Mar 30, 2004 10:00 pm   Post subject: (No subject)

yea... well... not really.... brownian was in row / colunm.... and had 1 MILLION variables... (i did not kow arrays cuz my teacher wouldn;t let me know... ) GRR!!!!.....

can u amagine having to declare 500 variables... and then acually work with them......

so... i basically slashed out all code.. and make it all array... and pixel....

since no one has complained i guess it was just me and u are able to move without large delay
in the process for moving (input.keydown blah blah) i have this
code:

        for z : 1 .. astnum  %%% SOMETHING LIKE 500!!!!!!
                if whatdotcolor (x (z), y (z)) = 1 or whatdotcolor (x (z) - 3, y (z) - 3) = 1 or whatdotcolor (x (z) + 3, y (z) + 3) = 1 or whatdotcolor (x (z) + 3, y (z) - 3) = 1 or
                        whatdotcolor (x (z)
                        - 3, y (z) + 3) = 1 then
                    touched := true
                end if
            end for

and for me that lags like crzy.....

has anyone here acually played this one on SC???
or the RED Light GREEN light????
i hope to be making the Jail Break 1 soon... that game ROCKED.... i have to be able to kill the guards... taht will be fun... Rolling Eyes

...... cool stuff....
thx for BITS!!!!
Tony




PostPosted: Tue Mar 30, 2004 10:23 pm   Post subject: (No subject)

processes, getch and whatdotcolor? Rolling Eyes

the_short1 - I was expecting better from you Confused you don't even use View.Update Thinking
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
jonos




PostPosted: Tue Mar 30, 2004 10:31 pm   Post subject: (No subject)

he didn't have to and it works great even if he used those things. maybe he wanted to practice them and see what he could make with them. i found no problem withthe game play.
the_short1




PostPosted: Tue Mar 30, 2004 10:56 pm   Post subject: (No subject)

yea im a whatdot color fanatic..... im become a dodge aprentice.... it just has SOO many uses....... also.... i dont bother with view.update cuz its not flickery.... waste of PC power.... but i guess i could...

NOTE: in wheres waldo i acually went offscreen only and view.update + whatnots... cuz i wanted it to draw then all before letting u see... Wink

ummmmmmm there is no way to avoid processes... or are there???

second: ummm.... i made this in like an hour.... i too lzy to start something big AGAIN... like pacman which took me four months... i think ill stick to making little programs in source code for the compsci users to learn and enjoy off of.... .. at least untill.... hmmm..... end of april... then i think i will make a new 'BIG' game... which is unknown at the momment....


PSSST: New game emerging Soon: Name J_ zB_ _l .. ehehe jonos Wink ... dont tell them... let em guesss.... Laughing

note: does anyone here have SC installed???? im gona need a screenshots of one of my maps with blacksheepwall enabled so i can see it all..... i dont have the HD space rite now cuz i got Roller Coaster Tycoon FULL! on PC.... so it takes up a lot... (no CD) i bough it off kazaa...... so i had to uninstall SC Crying or Very sad
Tony




PostPosted: Tue Mar 30, 2004 11:42 pm   Post subject: (No subject)

rollercoaster tycoon? Laughing the game comes in cerial boxes now days Laughing

and yes, you seriously don't need processes unless your playing music in the background... and even then, you could just time your program and relunch the song when it's almost over Thinking
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Sponsor
Sponsor
Sponsor
sponsor
the_short1




PostPosted: Wed Mar 31, 2004 8:16 am   Post subject: (No subject)

tony tony tony... have u not the new turing.....

2 new functions...:
Music.PlayFileLoop <<<loopz any kind of music.... then later....
Music.PlayFileReturn <<continies program after it starts music....


now.... to do sound effect at SAME time as background music.... easy....
have music going since start.... using a .MID file... and sound effects let them be mp3's and wavs... and they wont interupt ur program.....

REALY anoying... cuz the comps at my school dont have the new turing....(they are too lazy to update)... so i had to bring my version from home so i can work on my game with those features.....


so... yea... Tony...
u tell me a good way without processses to move ithout delays ... like.... its always gona let u move...... cuz i hate it when u press a button and it dont work cuz its not 'currently' at the movement code..... and it has to work on a slow comp..... in this case i ALWAYS have to be getting movement and i always have to check the collision.... i had it all in a loop... and movement was jerky.... and also i was able to run into stars... then many seconds later... it went into collision code and u lost...
u tell me.... and i will donate 10 bits to the person of ur choice....!! Wink
?? ? ?? ? ? ?? ? ? ???? ? ? ?? ? ? ?? ? ?? ? ? ? ? ? ?? ? ? ?
wahts so bad about processes???? they make the program much smoother....

also.. RCT doesn;t come in no cerial box...
guruguru




PostPosted: Wed Mar 31, 2004 5:00 pm   Post subject: (No subject)

YES IT DOES!!! I WAS LAUGHING SO HARD WHEN I FOUND IT Very Happy !!! It's in "Kellog's Honey Nut Cheerios"!!! LOL
Tony




PostPosted: Wed Mar 31, 2004 7:41 pm   Post subject: (No subject)

the_short1 -
code:

var time1,time2:int
var move:boolean := false
var c:string(1)

time1 := Time.Elapsed
loop
time2 := Time.Elapsed

if time2-time1>1000 then
move:=true
end if

if hasch and move then
getch(c)
put "you have moved"
time1:=Time.Elapsed
move:=false
elsif hasch and move=false then
getch(c)
put "you can't move yet"
end if
end loop


that's right! no processes Very Happy

and see - guruguru confirms that rollercoaster tycoon comes in cerial boxes Laughing
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
the_short1




PostPosted: Wed Mar 31, 2004 8:43 pm   Post subject: (No subject)

umm... true thats a good way for timer.. granted... .... but... i want to be able to move 100 % of time.. not only once a second...!!!!!..... .. still waht is wrong with processes???????


HAH!!!!!!! !!!!!!! tell me the number at the top left of the screen... for me it took 3500 average...
code:

var blah : int
var y, x : array 1 .. 50000 of int
for a : 1 .. astnum
    randint (x (a), 0, maxx)
    randint (y (a), 50, maxy - 50)
end for
        blah := Time.Elapsed
        for g : 1 .. astnum
            drawfillstar (x (g) - 3, y (g) - 3, x (g) + 3, y (g) + 3, black)
            randint (x (g), x (g) - 3, x (g) + 3)
            randint (y (g), y (g) - 3, y (g) + 3)
            if whatdotcolor (x (g), y (g)) = 1 or whatdotcolor (x (g) - 3, y (g) - 3) = 1 or whatdotcolor (x (g) + 3, y (g) + 3) = 1 or whatdotcolor (x (g) + 3, y (g) - 3) = 1 or whatdotcolor (x (g)
                    - 3, y (g) + 3) = 1 then
                touched := true
                exit
            elsif whatdotcolor (x (g), y (g)) not= 4 and whatdotcolor (x (g) + 3, y (g) + 3) not= 4 and whatdotcolor (x (g) - 3, y (g) - 3) not= 4 and whatdotcolor (x (g) + 3, y (g) - 3) not= 4 and
                    whatdotcolor (x (g) - 3, y (g) + 3) not= 4 and whatdotcolor (x (g), y (g)) not= 2 and whatdotcolor (x (g) + 3, y (g) + 3) not= 4 and whatdotcolor (x (g) - 3, y (g) - 3) not= 2 and
                    whatdotcolor (x (g) + 3, y (g) - 3) not= 2 and
                    whatdotcolor (x (g) - 3, y (g) + 3) not= 2 then
                drawfillstar (x (g) - 3, y (g) - 3, x (g) + 3, y (g) + 3, 14)
            end if
        end for
        locate (1, 1)
        put Time.Elapsed - blah


Now.. if i had movement in taht main game loop.... if i hit a key... it wouldn;t move....cuz for me it takes 3500 miliseconds to draw all the stars..!!! ....... so i need on a process...

now,.., i did the same test on my process... and guess what it takes 1 milisecond ... and when i am acually pressying a key.. its under 500 miliseconds... so.... the process way is FASTER>.... tell me what is wrong with a process????

RCT... dam... tahts crap on a stick.... it is a fun games tho...... # 2 is prob funner, it took too mch HD space for the full version w/no cd.... ...... ..
common... cleaning up after ppl's puke... building wicked rides....
Tony




PostPosted: Wed Mar 31, 2004 9:06 pm   Post subject: (No subject)

processes are bad... very bad... cuz they're random Rolling Eyes
code:

var a1,a2,a3:int
a1:=0
a2:=0
a3:=0
process p1
loop
a1+=10
end loop
end p1
process p2
loop
a2+=10
end loop
end p2
process p3
loop
a3+=10
end loop
end p3

fork p1
fork p2
fork p3

loop
drawfillbox(0,100,a1,110,red)
drawfillbox(0,120,a2,130,blue)
drawfillbox(0,140,a3,150,green)
exit when a1>maxx or a2>maxx or a3>maxx
cls
end loop


or

code:

process a1
loop
put "1"
end loop
end a1

process a2
loop
put "0"
end loop
end a2

fork a1
fork a2


see how output is random... heck, sometimes it is even mixed up together Rolling Eyes use of processes does not speed up the program, it slows it down... by a lot.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
the_short1




PostPosted: Wed Mar 31, 2004 10:03 pm   Post subject: (No subject)

well the first one shows the truth..... the reason the second bar one is less is cuz it was still processing the first fork statement... and the 3rd bar is even less because it takes time to fork the statement.... by the time turing is ready for the next file... the first forked one is already working....

also.. the second one is messed cuz 1 and 0's take different times... WHO CARES IF ITS RANDOM!!!! its easy... ok... u mite be right ... it might slow it down by having another process..... still what was that number???? hmm??? what was the number at top left????

Tony Vs. Kevin....... FIGHT!!!
hahahah Wink
Tony




PostPosted: Thu Apr 01, 2004 9:09 am   Post subject: (No subject)

oh Kevin - you're on Twisted Evil

Next Round! *Ding!Ding!*

first of all - the reason your collision loop is soo slow is because you use a shitload of whatdotcolors to look all around. Whatdotcolor got to be one of single most slow functions there are Laughing

Most importanly, if it takes half a second to loop through all of the stars, that means that even if you touch the start in your movement process, there's up to 0.5 of a second before that start actually checks if there's anything around it and the player could have been well gone by then Confused

Why don't you try to optimise your program instead? I'd bet you all your bits I could write a faster program then you without the use of processes Twisted Evil
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
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  [ 18 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: