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 Professional Discussion / PLS HELP ME in this darkbasic codes

Author
Message
Hello Everyone !
14
Years of Service
User Offline
Joined: 1st Sep 2011
Location:
Posted: 1st Sep 2011 14:38
my codes are




my problem is in line


it says that the sprite does not exist. but it is clearly existing. pls help me

<angelo>

i have a problem in darkbasic codes. pls help me
Mugen Wizardry
User Banned
Posted: 1st Sep 2011 15:10
if sprite exist(sprite_id)
`load all sprite stuff here
endif

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 1st Sep 2011 15:32
I'm not sure if this is the problem.. PlatformID = 101,102,103, and I think you are looking for 1,2,3, but it's hard to figure out without testing it.

for i = 1 to 3
platformID(i) = 100 + i

platform1_x(1) = 100
platform1_y(1) = 150
platform1_x(2) = 200
platform1_y(2) = 250
platform1_x(3) = 300
platform1_y(3) = 450
next i

JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 2nd Sep 2011 22:14 Edited at: 2nd Sep 2011 22:20
I agree with Pincho with this. Your setting up the platformID() as an array and i is the variable that is used for WHICH part of the array. In this case your setting up like this :

i = 1
platformID(i) = 101

i = 2
platformID(i) = 102

i = 3
platformID(i) = 103

This means that platformID = the number you set it as. The i is still set as its normal number of 1 to 3. But the i is not a permanent number. You can change it to whatever you want within the array. But you made the platformID permanent until you change it later.

EDIT : Also take a look at what pincho is showing you here..

for i = 1 to 3
platformID(i) = 100 + i

platform1_x(1) = 100
platform1_y(1) = 150
platform1_x(2) = 200
platform1_y(2) = 250
platform1_x(3) = 300
platform1_y(3) = 450
next i

You are changing the array of platformID but your not changing anything else. So your actually wasting CPU cycles assigning the same variables 3 times in a row. This is what I mean :

platform1_x(1) = 100
platform1_y(1) = 150
platform1_x(2) = 200
platform1_y(2) = 250
platform1_x(3) = 300
platform1_y(3) = 450

Those are not changing. Those are set each time you go around.

"Son, I crap bigger then you !"
Hello Everyone !
14
Years of Service
User Offline
Joined: 1st Sep 2011
Location:
Posted: 4th Sep 2011 17:58
oh tnx a lot guys. it really helps me a lot.

i have a problem in darkbasic codes. pls help me
Hello Everyone !
14
Years of Service
User Offline
Joined: 1st Sep 2011
Location:
Posted: 4th Sep 2011 20:48
i have a problem again. im making side scrolling view. i heard that only the background will move. can you give me some codes for that? if my character go to the right the bg will move. if my character go back to the left my bg will move again. plss help me . cant find good codes. tnx a lot guys . GodBless


<Angelo>

i have a problem in darkbasic codes. pls help me
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 4th Sep 2011 22:58 Edited at: 4th Sep 2011 22:58
We generally don't like "gimme da codez" messages. The place where you paste the background image at 0,0 is the coordinates of the upper left corner of the screen. You can paste the image off the screen as well (like -10,0) and the image will be shifted to the left by 10 pixels. Make the 0,0 variables instead that decrease/increase when the player "moves" and you have a moving background.

Hello Everyone !
14
Years of Service
User Offline
Joined: 1st Sep 2011
Location:
Posted: 6th Sep 2011 13:29
i try what you are sayin dude. but it not helps me a lot. im trying to say is that when my character is in the end of the X axis. the background will start to move so that it will look like a side scrolling view or when my character starts to move the background will also move. tnx

i have a problem in darkbasic codes. pls help me
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 7th Sep 2011 00:12
Something like this perhaps?

Login to post a reply

Server time is: 2026-07-10 23:33:10
Your offset time is: 2026-07-10 23:33:10