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.

2D All the way! / Composing strings

Author
Message
Code Stealer
21
Years of Service
User Offline
Joined: 12th Feb 2004
Location:
Posted: 3rd Apr 2004 19:11
I want to load a lot of images, butIm not sure how to assemble the strings correctly.

I have 4 images called

image_01.bmp
image_02.bmp
image_03.bmp
image_04.bmp


How do I write the program to load them with not much code?


for n=1 to 4
imagestring$="image_0" n ".bmp",n
load image filenamestring$,image
next n


how do I get the correct number as "n" into the string?

GIve me more power!
Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 3rd Apr 2004 19:30
Erm I've posted this to you twice already. Just look up the other posts.

Code Stealer
21
Years of Service
User Offline
Joined: 12th Feb 2004
Location:
Posted: 3rd Apr 2004 19:37
I cant find which thread its on! I remember you posted it for me a while back, but I cant find it! Sore to be such a pain Pincho!

GIve me more power!
Morloc
21
Years of Service
User Offline
Joined: 21st Mar 2004
Location: UK
Posted: 3rd Apr 2004 19:48
just out of curiosity how do you assign an int to a char. ie age$ = N (N being an int) doesnt work

Morloc
medwayman
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: uk
Posted: 3rd Apr 2004 21:42 Edited at: 3rd Apr 2004 22:08
For less than 10 images


For more than 10 images EDIT: or you could just drop the first zero and use the above method. Didn’t think of that when I wrote it. D'oh!



Just in case Pincho’s had enough lol

Based on Amiga PD game Squigs. Early shots: http://www.custardsoft.pwp.blueyonder.co.uk/images/03.png

Code Stealer
21
Years of Service
User Offline
Joined: 12th Feb 2004
Location:
Posted: 4th Apr 2004 00:01
Thank you I got the code working, now to finish the graphics loading routine! I reakon Im gonna have 50x4x3x5frames to organise, so I need to split them up into race,colour,unit,action,frame so I get a huge number, but easy to read. The code for the first frame is 11101001, and I noticed that if I used a number that was 10xlarger the image wouldnt load, so I think the highest number you can use for an image number is 99,999,999.

GIve me more power!

Login to post a reply

Server time is: 2025-05-14 04:35:29
Your offset time is: 2025-05-14 04:35:29