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 / Question about items

Author
Message
Blazer
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: United States
Posted: 17th Feb 2003 19:17
i have 26 items right now for my game each are sybolized by:
Item_no.#.

is there a way to say something like:

if any of the Item_no.#= whatever then something happens

so I won have to go down evry single item and say:

if Item_01#= this then do this
if Item_02#= this then do this
ect.....

plese help
As I walk through the vally of the shadow of death, I will fear no evil.
- Psalms 23:4
bitJericho
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 17th Feb 2003 19:27
You my friend are in need of arrays...

check out the online help for info about arrays, under tutorials i think

Blazer
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: United States
Posted: 17th Feb 2003 19:45
ok I got that, thx. but i need to be able to make it as text. but if I set it to item(i)="empty" then it gives me an error.

I need it so it can be used as text too, plese help

As I walk through the vally of the shadow of death, I will fear no evil.
- Psalms 23:4
Attreid
21
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 17th Feb 2003 20:22
You're un need of text arrays...


add $ after the arrays' name, and they'll be able to stocl text

I'm following John, but I'm not john.
Lol, it is funnier in french
Blazer
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: United States
Posted: 17th Feb 2003 21:28
thanks all, that helps a lot

As I walk through the vally of the shadow of death, I will fear no evil.
- Psalms 23:4
Blazer
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: United States
Posted: 17th Feb 2003 22:30
wait nother problem:

How I use the array data?
I want to make it like this:

for i=0 to 25
if Item$(i)="Sword"
sprite 100,X cordonit array data, y cordonit array data,100
endif
next i

how do I put in and extract the array data for all my items. I know this one is a bit more complex, but much appriciated if I could get soem help.

As I walk through the vally of the shadow of death, I will fear no evil.
- Psalms 23:4

Login to post a reply

Server time is: 2024-05-19 18:05:18
Your offset time is: 2024-05-19 18:05:18