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.

DarkBASIC Discussion / Hello, need help moving a value through an array

Author
Message
Los
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Location:
Posted: 23rd Dec 2005 09:35
I'll give you some code to help explain what I'm doing.



It should look like this each time you press the upkey()

000
000
050

000
050
000

050
000
000

I can't quite see how to do it.

**Officialy has a mental illness.
" Ahh to finish something! My boy, have you ever accomplished anything? "
blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 23rd Dec 2005 10:56 Edited at: 23rd Dec 2005 10:58


-- or --



The first method remembers where the 5 is, and moves it up one, the second method moves the whole middle column up one place.

You could make your code more responsive by putting your 'repeat; until upkey()=0' just before the 'endif', and I recommend you put a 'cls' before the 'set text opaque' to combat the flickering-empty screen problem (which only occurs on some machines, but mine is one of them).

Don't forget 'sync', either.

16-colour PNGs pwn.
Los
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Location:
Posted: 23rd Dec 2005 12:32 Edited at: 23rd Dec 2005 12:34
thank you, I'll try and get it to work in my program.

what I was trying to do was something like this:

plane(2,3)-1 = 5
plane(2,3) = 0

I was farting about with minus sign.

what I'm trying to do is make a game where you move around a maze, it's like a large array, 1's for walls or something, its proving pretty difficult even with 2D. If I have a long hall way, like this

111
101
101
101
101
101

(where 1's are walls) I want to test how many places forward you need to go before putting up a wall... so really I'm moving about the array... I really hope I can get the hang of this :/

**Officialy has a mental illness.
" Ahh to finish something! My boy, have you ever accomplished anything? "
blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 23rd Dec 2005 13:18
Quote: "
plane(2,3)-1 = 5
"


plane(2,3-1)=5

16-colour PNGs pwn.

Login to post a reply

Server time is: 2025-05-23 02:51:17
Your offset time is: 2025-05-23 02:51:17