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

Username:   Password: 
 RegisterRegister   
 Box Platformer
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
G309489516




PostPosted: Tue May 25, 2010 9:16 pm   Post subject: Box Platformer

Being consistently bored in CompSci class, I decided to use my time in a much more interesting way.
I've only finished the tutorial portion so far, as it's still a work in progress.
Feedback is appreciated.



Box0.01.rar
 Description:
Box0.01 Purely Prototype.

Download
 Filename:  Box0.01.rar
 Filesize:  1.04 MB
 Downloaded:  226 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
G309489516




PostPosted: Wed May 26, 2010 6:47 am   Post subject: RE:Box Platformer

cmon, I need some feeback here. Razz
chrisbrown




PostPosted: Wed May 26, 2010 9:34 am   Post subject: RE:Box Platformer

Not bad, runs a little fast on my machine. Post your source code if you want meaningful feedback.
G309489516




PostPosted: Thu May 27, 2010 7:22 am   Post subject: Re: Box Platformer

code inc.


box.t
 Description:
Here.

Download
 Filename:  box.t
 Filesize:  12.39 KB
 Downloaded:  156 Time(s)

yumrum




PostPosted: Mon May 31, 2010 6:01 pm   Post subject: RE:Box Platformer

First of It's Pretty cool.... Now

1. I would say you need to put a limit on the speed for computers because it runs way to fast on my computer.

2. The box's magic aura thingy should be reset at the beginning of the level so that you don't carry it forever.

3. If this is a school project i would recommend comments

4. Possible add a sprite to the box.

P.S love how you use a driver loop
Cezna




PostPosted: Mon May 31, 2010 6:41 pm   Post subject: RE:Box Platformer

Cool, but it goes off the edge of my screen a bit
Are you using specific numerical sizes in your setscreen line, or max;max ?

Also, it is a little too sensitive, but like you said, it's just a prototype.

Overall great job !
Tony




PostPosted: Mon May 31, 2010 6:56 pm   Post subject: RE:Box Platformer

since you are already using Music.PlayFileReturn, it does not need to be in a process.

code:

        fork KILL
        fork music

Does this work? (seems that the intention is to play two mp3s at the same time, which Turing doesn't do...)

Having a procedure for each level seems like a lot of repetition.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Cezna




PostPosted: Mon May 31, 2010 7:52 pm   Post subject: RE:Box Platformer

I see people talking about it running to fast on their machines
I haven't looked at the source yet, but if the speed is variable, I am assuming you used a simple delay.

Using Time.DelaySinceLast will compensate for differences in computer speeds.
It will make sure the computer is delayed for a minimum amount of time since the last time it reached the delay line. So if it goes through the calculations really fast, it spends longer waiting in the delay. More time in calculations, less time in delay.
Sponsor
Sponsor
Sponsor
sponsor
G309489516




PostPosted: Wed Jun 02, 2010 8:24 am   Post subject: Re: Box Platformer

Thanks for the replies.

@Cezna
Using the Time.DelaySinceLast seems pretty useful, I'll try to work that in.

@Tony
Thanks for pointing that out. Looks like I need to clean up a bit more.

@yumrum
The aura does reset, it's just the graphic take a bit of time to 'stablize'.

Please continue with the awesome feedback, I'll post an updated version of the code soon.

Edit: Could you elaborate more on Time.DelaySinceLast?
Cezna




PostPosted: Fri Jun 04, 2010 2:27 pm   Post subject: Re: Box Platformer

The syntax for Time.DelaySinceLast is the same as the syntax for delay

You would just put Time.DelaySinceLast (200), for example, and this would create a delay of 200 milliseconds.

With delay, it's going to pause for 200 milliseconds no matter what, and so the computer you are coding on might be slow, and so it will take maybe 400 milliseconds to complete a loop, taking 200 milliseconds on the calculations and whatnot (the code).
But then if you go on a faster computer, it will only take it 50 milliseconds to work through the code, completing the loop in 250 milliseconds, and this may make the program run too fast (this would be especially relevant in graphics-based programs such as games).

With Time.DelaySinceLast, Turing remembers what time it was when it last encountered the delay statement, and it compares that to the time when it reaches it again. If it is less time than is specified in the Time.DelaySinceLast statement, it will wait until it has been long enough before continuing. If it is more time than specified, it will skip over the delay and continue.

So if you told it to Time.DelaySinceLast (200), this time, if it took the slow computer took 200 milliseconds in calculations, it will see that it has been 200 milliseconds since the last time it was at the delay, and will skip over it. However the fast computer will see that it has only been 50 milliseconds since it was last at the delay, and it will wait for another 150 milliseconds to satisfy the delay, before continuing.

This makes Time.DelaySinceLast a great way to ensure similar performance across machines with varying speeds. The only thing is that it can't help computers that are too slow, it only slows down computers that are very fast. So if you had a very slow computer that took 300 milliseconds to do calculations, it would see that it has been more than 200 milliseconds since it last was at the delay, and it will skip past it and continue, but it will still take it 300 milliseconds per loop. This still beats a regular delay, as if you put delay (200), then the computer would be waiting for 500 milliseconds, further slowing it down.

But with the sort of time scales you would normally be dealing with in a graphics-based program such as a game, the amount of time you're going to be delaying for will probably be more than the amount of time necessary to carry out calculations on most computers.

If you have any more questions, try looking up Time.DelaySinceLast in the help section on Turing (just type Time.DelaySinceLast in Turing, highlight it, and press F9 to bring up the help section on it.

Also, if you have any trouble making this game, feel free to PM me, as I have made one or two platformer games in the past (in fact I am still working on one now and then as sort of an ongoing side project), which I spent an awful lot of time on, and had to solve an awful lot of problems for, so I might be able to give you some pointers.
G309489516




PostPosted: Fri Jun 04, 2010 7:48 pm   Post subject: Re: Box Platformer

Hrm, I tried the Time.DelaySinceLast today, and adjusted the delay to 20 cuz it was running too fast on my comp. But now there's a new bug, which occurs on tutorial level 3. When you jump over the wall and try to go to the next level with an aura on, it glitches out with this section of code highlighted

code:
px := Rand.Int (x - 20, x + l + 20)


and this message:

code:
'Process "rage": low value passed to randint greater than high value.'


The more i think about it, the less it makes sense, because with that equation, the 2nd number MUST be greater....?
Cezna




PostPosted: Fri Jun 04, 2010 8:07 pm   Post subject: RE:Box Platformer

I've tried to repeat this glitch and can't seem to find the problem, but you're right, that dosn't make sense... unless x is negative and for some reason the code preceeding is effectively making it positive (like multiplying by -1)

I would have to be able to reproduce the glitch in order to figure out what's going on, but I can't seem to do that... level three is the one before the purple box right?

I did find one glitch, which is that in the first level with the aura, if you leave it on, and don't use the super jump for a while, then it will still stay you're in Hyper Mode, and the top number says 250, but I can't use the super jump, and trying to recharge it again (even though it appears to be charged already) and even restarting the level, dosn't do anything.

I HIGHLY recommend that you don't use absolute coordinates for collision detection, such as saying if x of box >= x of wall then...
Use whatdotcolour or something along those lines, it makes level design a lot easier, and even allows you to make levels in paint or another graphics program like GIMP (this is what I am doing for my latest side-scrolling game)
G309489516




PostPosted: Tue Jun 15, 2010 6:15 pm   Post subject: RE:Box Platformer

Sorry about this, I've sorta been neglecting this project cuz of exams >.< but I'll get back on it in 2 days time.
USEC_OFFICER




PostPosted: Wed Jun 16, 2010 11:50 am   Post subject: RE:Box Platformer

That's fine. Take as much time as you want. It's your project.
Cezna




PostPosted: Wed Jun 16, 2010 3:21 pm   Post subject: RE:Box Platformer

The longer you take, the better it will end up!
Very Happy
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 1  [ 15 Posts ]
Jump to:   


Style:  
Search: