Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

The 20 Line Challenge / spike floor

Author
Message
all of the above
16
Years of Service
User Offline
Joined: 2nd Sep 2007
Location: Anywhere an elf or kithkin may be hiding
Posted: 2nd Sep 2007 23:54
It may not be very interesting but I made a spike 'floor' in 10 lines of code. I could have done it in less, but then it wouldn't be very readable.

I used the variable 'i' like an array. If you were to, say, move object 7 backwards a little, it would work.
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 4th Sep 2007 02:50 Edited at: 4th Sep 2007 02:51
I was bored so I decompressed your code
I've changed a couple of things so it works in DBC
That's a nice collection of cones you got there



[edit]
Oh yeah, never use DO LOOP like that, loops are for repeating things not for just waiting.

In programming, nothing exists
Mr Kohlenstoff
17
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Germany
Posted: 8th Sep 2007 15:56 Edited at: 8th Sep 2007 15:58
1. You need one more sync (at least on my computer), otherwise the screen is just black.


Quote: "Oh yeah, never use DO LOOP like that, loops are for repeating things not for just waiting."


2. The do-loop-method has the advantage, that the screen is still refreshed, when the application was minimized, and in your version the screen is not updated again, so you don't see anything afterwards.

Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 8th Sep 2007 20:10 Edited at: 8th Sep 2007 20:15
Quote: "2. The do-loop-method has the advantage, that the screen is still refreshed, when the application was minimized, and in your version the screen is not updated again, so you don't see anything afterwards. "

There's a check to see if the program has been minimized isn't there? Then you could sync after returning and that would save... whatever it saves

[edit]
found it: SCREEN INVALID()

So the new code would be:


In programming, nothing exists
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 8th Sep 2007 20:25 Edited at: 8th Sep 2007 20:26
OK that's strange. I found that adding wait 50 before the sync made it work, but after that it doesn't work properly so forget about it.
Stick with the Do Loop thing if you really need it.

In programming, nothing exists

Login to post a reply

Server time is: 2024-04-19 21:41:54
Your offset time is: 2024-04-19 21:41:54