Game Design Music and Art

won't appear – gaurdianAQ

gaurdianAQ

Member

Posts: 106
From:
Registered: 01-15-2007
Graphics (800,600)
Const enemy$ = "<O>"
Type enemy
Field x,y
Field enemystring$
End Type
ship.enemy = New enemy
ship\x = 100
ship\y = 0
ship\enemystring$ = enemy$
SeedRnd MilliSecs()
Dim alien$(3,24)
While Not KeyDown(1)
Cls
Text ship\x, ship\y, ship\enemystring$
Repeat
;display the array
For rows = 0 To 2
For columns = 0 To 14
;Write each value to the screen
Text ship\x, ship\y, ship\enemystring$(rows,columns)
Next
;write a new line after each row
Print ""
Next
Until ship\x >= 700
ship\y = ship\y + 3
Repeat
Cls
Text ship\x, ship\y, ship\enemystring$
ship\x = ship\x - 1
Flip
Until ship\x <= 100
ship\y = ship\y + 3
Flip
Wend

why won't the text appear on the screen? I am no good with arrays yet
Mene-Mene

Member

Posts: 1398
From: Fort Wayne, IN, USA
Registered: 10-23-2006
I'll work on this later.

------------------
MM out-
Thought travels much faster than sound, it is better to think something twice, and say it once, than to think something once, and have to say it twice.
"Frogs and Fauns! The tournament!" - Professor Winneynoodle/HanClinto

ArchAngel

Member

Posts: 3450
From: SV, CA, USA
Registered: 01-29-2002
don't forget to tell us what language the code is in

------------------
Realm Master: "I'm cockasian"
Soterion Studios

Mene-Mene

Member

Posts: 1398
From: Fort Wayne, IN, USA
Registered: 10-23-2006
Yeah, I usually put a " - BM/BB/B3d/B+/C++/..." at the end whatever's applicable. BTW, this is B3d.

------------------
MM out-
Thought travels much faster than sound, it is better to think something twice, and say it once, than to think something once, and have to say it twice.
"Frogs and Fauns! The tournament!" - Professor Winneynoodle/HanClinto

gaurdianAQ

Member

Posts: 106
From:
Registered: 01-15-2007
would it be better to learn torque? after I learn blitzbasic?
Mene-Mene

Member

Posts: 1398
From: Fort Wayne, IN, USA
Registered: 10-23-2006
Uh... I went onto BM. I can't help with Torque. You may also try C++ thats the industry standard.

But, Matt Langely would be the one to ask on Torque.
------------------
MM out-
Thought travels much faster than sound, it is better to think something twice, and say it once, than to think something once, and have to say it twice.
"Frogs and Fauns! The tournament!" - Professor Winneynoodle/HanClinto

[This message has been edited by Mene-Mene (edited January 18, 2007).]

samw3

Member

Posts: 542
From: Toccoa, GA, USA
Registered: 08-15-2006
Um, you're right you don't quite have array's yet. (no offense)

According to your code ship\enemystring$ is a string "<O>" not an array:

Const enemy$ = "<O>"
ship\enemystring$ = enemy$

Here's a quick analogy that helped me learn arrays a long time ago:

Arrays are like post office boxes. The post office is the variable name. The PO Box number is the "index" of the array. So in basic you might have this code

Dim PostOffice$(200)

'200' here is the number of nodes(PO Boxes) in the array
To put something into one of the mailboxes.. say PO Box 120 you would:
PostOffice$(120) = "Hello Grandma"

To check a mailbox, PO Box 56 for example:
print PostOffice$(56)

But to see the real power of arrays, how about the following example.
Say you want to put a letter into all the boxes from PO Box 45 to 195
for i=45 to 195
PostOffice$(i) = "Buy cheap viagra online!"
next i

Here as 'i' changes through the loop, so does the PO Box that is referenced.

This analogy does break down however in the following sense. Our array post office boxes can only hold one letter. So, in this example:

PostOffice$(120) = "Hello Grandma"
PostOffice$(120) = "Hello Aunty"

Grandma's 'letter' goes into oblivion and is replaced by the letter to Aunty.

Does that help you understand arrays a little bit better?

Multidimensional array work exactly the same way, except there are two numbers to address the node so:

Playfield$(15,10) = "*"
Playfield$(15,11) = "^"

are two different nodes.

Just keep at it, you'll figure it out.

------------------
Sam Washburn

gaurdianAQ

Member

Posts: 106
From:
Registered: 01-15-2007
well I had a working array before but I tryed changing it to make it move but then it got screwed up wait I know
gaurdianAQ

Member

Posts: 106
From:
Registered: 01-15-2007
ok I can't figure this out what i need is a code that will allow me to move an entire array of guys instead of just one
gaurdianAQ

Member

Posts: 106
From:
Registered: 01-15-2007
what I need is a way to use a type to place the array in a certain position and to move it I tryed using the text command but that puts all the text in that one spot is there a way so I can position an entire array with text?
Mene-Mene

Member

Posts: 1398
From: Fort Wayne, IN, USA
Registered: 10-23-2006
I'm confused at what you're asking.

<BLOCKQUOTE><table width=80% border=0 bgcolor="#FFFFF" CELLPADDING="2" CELLSPACING="2"><TR><TD><font size="3" face="Courier" color="#000000"><pre>
AlienS$(2,14) ;Array of Strings for Aliens
AlienX(2,14) ;Array of X for Aliens
AlienY(2,14) ;Array of Y for Aliens
AlienSpeed(2,14) ;Array of Speed for Aliens


ColAliennum = 14 ;How many in each column of array. Set to starting amount
RowAliennum = 2 ;How many in each row of array Set to starting mount

for rows = 0 to RowAliennum
for columns = 0 to ColumnAliennum
AlienString$(rows,columns) = "<O>"
next
next

;Main loop

for rows = 0 to RowAlienNum
for columns 0 to ColumnAlienNum
AlienX(rows,columns) = AlienX(rows,columns) + AlienSpeed(rows,columns)
AlienY(rows,columns) = AlienY(rows,columsn) + AlienSpeed(rows,columns)
next
next

</pre></font></TD></TR></TABLE></BLOCKQUOTE>

Its possible to do the above but its easier to do this.

Type AlienT

Field X
Field Y
Field String$

End Type

for a = 0 to (2 * 14)

Alien.AlienT = new AlienT

next

for all.AlienT = each AlienT ;!!!! This is the loop
All\String$ = "<O>

next

;I want to move aliens right 1 pixel.

for all.AlienT = each AlienT
All\X = All\X + 1
next

this should work.

------------------
MM out-
Thought travels much faster than sound, it is better to think something twice, and say it once, than to think something once, and have to say it twice.
"Frogs and Fauns! The tournament!" - Professor Winneynoodle/HanClinto

[This message has been edited by Mene-Mene (edited January 19, 2007).]

gaurdianAQ

Member

Posts: 106
From:
Registered: 01-15-2007
this does not work I get variable type mismatch
gaurdianAQ

Member

Posts: 106
From:
Registered: 01-15-2007
or expecting )
Mene-Mene

Member

Posts: 1398
From: Fort Wayne, IN, USA
Registered: 10-23-2006
I don't know what's going on, I need to go to bed. maybe fresh eyes will see the problem. A hint, B3d & BM points you to the problematic line.

------------------
MM out-
Thought travels much faster than sound, it is better to think something twice, and say it once, than to think something once, and have to say it twice.
"Frogs and Fauns! The tournament!" - Professor Winneynoodle/HanClinto

gaurdianAQ

Member

Posts: 106
From:
Registered: 01-15-2007
I know I am using the trial of b3d
Mene-Mene

Member

Posts: 1398
From: Fort Wayne, IN, USA
Registered: 10-23-2006
Thats what I'm using as well.

------------------
MM out-
Thought travels much faster than sound, it is better to think something twice, and say it once, than to think something once, and have to say it twice.
"Frogs and Fauns! The tournament!" - Professor Winneynoodle/HanClinto

gaurdianAQ

Member

Posts: 106
From:
Registered: 01-15-2007
I don't think it can be done so for now I am going to use something else for my game or if it can be done it is something very complex
Mene-Mene

Member

Posts: 1398
From: Fort Wayne, IN, USA
Registered: 10-23-2006
Not really, usually after an error message It'll point your current selection to the problematic line.

------------------
MM out-
Thought travels much faster than sound, it is better to think something twice, and say it once, than to think something once, and have to say it twice.
"Frogs and Fauns! The tournament!" - Professor Winneynoodle/HanClinto

gaurdianAQ

Member

Posts: 106
From:
Registered: 01-15-2007
I figured it out it is unorthadox but it works
gaurdianAQ

Member

Posts: 106
From:
Registered: 01-15-2007
aaahhhh now its not working again now that I tryed to put it into my main program I guess this is to be expected in game design I am not used to programming games