Topic:   Strings Strings and more Strings   (Read 14807 times)


0 Members and 1 Guest are viewing this topic.

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: Strings Strings and more Strings
« Reply #15 on: December 14, 2011, 02:19:42 PM »
Yeah that's true. I can work that in. Also, I'm gonna dig up that old thread where we talked about DRAWIMAGE or whatever the function is and how it works without adding a sprite... It would be more like using the canvas. I think I'm more ready to try it out.
EDIT: I remember: The goal had been to somehow make sure the program can get images out of the folder they were installed in, because DRAWIMAGE requires a file path. But it could possibly lag if it has to open the file each time.
EDIT #2: I used the example code where the user finds a file, and had it print the string with the location. It looks like this:
Macintosh HD:Users:mcharneys:Desktop:image.gif
So the standard ~/Desktop/Image.gif will not work.
« Last Edit: December 14, 2011, 02:54:29 PM by Connors »
Warning: The above post may have been modified multiple times.

"In a great game, the character must never perfectly obey the user's command"
 - Tim Rogers

http://connorspuzzles.tumblr.com/

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: Strings Strings and more Strings
« Reply #16 on: December 14, 2011, 02:48:25 PM »
Yeah. Sc needs a way to store images and then draw stored images by calling it's ID.
On load:
LoadImage("/myImages/ball.png", "ball")
On draw:
DrawImage("ball",x,y)

Mike's been too busy lately to add new features. :/
« Last Edit: December 14, 2011, 02:49:02 PM by Gandolf »

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: Strings Strings and more Strings
« Reply #17 on: December 14, 2011, 02:55:05 PM »
Oh you posted while I was typing something. [smiley=cheesy.gif]
It would be great if LoadImage could start from the folder the game was in though!
OR just add one that uses the imported sprites. That would be amazing.
« Last Edit: December 14, 2011, 02:58:07 PM by Connors »
Warning: The above post may have been modified multiple times.

"In a great game, the character must never perfectly obey the user's command"
 - Tim Rogers

http://connorspuzzles.tumblr.com/

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: Strings Strings and more Strings
« Reply #18 on: December 14, 2011, 03:01:51 PM »
Indeed, being able to use imported sprites would solve the problem.

Circuit


  • GMG-er

  • **


  • Posts: 299

  • blast from the past
Re: Strings Strings and more Strings
« Reply #19 on: December 14, 2011, 03:20:46 PM »
That looks cool.  I remember playing a game like this on OS 7.

Quote
While we're talking about SC can conditionals in IF statements use AND or OR? I really would like this. I'm not sure how to do it. I have to make it push boxes onto floors OR goals and I want to walk across either of these. If I can't say OR it will require TWO COPIES OF THE SAME CODE. Thanks again!
SC can't do AND or OR, but you can create the same effects using nested IFs.  An OR would be like this:
Code: [Select]
IF (something is true) THEN
  //do stuff
ELSE
  IF (something else is true) THEN
    //do stuff
  END IF
END IF
Put the "do stuff" code in a method, and call the method each time.

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: Strings Strings and more Strings
« Reply #20 on: December 14, 2011, 03:26:34 PM »
thing is //do stuff will be the same. I suppose i should just use a method. But there's always more than one way with programming!
« Last Edit: December 14, 2011, 03:30:23 PM by Connors »
Warning: The above post may have been modified multiple times.

"In a great game, the character must never perfectly obey the user's command"
 - Tim Rogers

http://connorspuzzles.tumblr.com/

GMG Kurt


  • GMG-er

  • **


  • Posts: 682

  • Sorry for being such a noob
Re: Strings Strings and more Strings
« Reply #21 on: December 15, 2011, 09:06:37 PM »
It'd be there for the whole running of the program so I suggest one variable flag you use in those situations over and over again
Just your average Weekend Warrior.
Yes I know I have bad spelling, it's what makes me such a good programmer!

"Old art, weather magnificent or wretched, is always the raw material of new art. The artist's job, though, is to

Al Staffieri


  • GMG-er

  • **

  • no avatar

  • Posts: 452

  • I love GameMaker
Re: Strings Strings and more Strings
« Reply #22 on: December 17, 2011, 08:30:27 AM »
Quote
thing is //do stuff will be the same. I suppose i should just use a method. But there's always more than one way with programming!


You can do it this way


dostuff = 0
IF (something is true) THEN dostuff = 1
IF (something else is true) THEN dostuff = 1
IF dostuff = 1 THEN
 // do stuff here
END IF

EqwanoX


  • Administrator

  • GMG Extraordinaire

  • *****


  • Posts: 1180
Re: Strings Strings and more Strings
« Reply #23 on: December 17, 2011, 09:35:12 AM »
what are you all talking about? why would you use drawimage when you have sprite sheets?

why would you use nested IFs when you can use select case

Quote
This happens every time and I'm sure this has come up before BUT how do I change a square of the map$ array?
FOR EXAMPLE:
map$(1) = "1,1,1,0,P,0,1,1,1,1"
I want to make the "P" a "0". Is it REPLACE$ or is that a different purpose?
assuming your useing movex variables to track the player position you can do it in one line

let map$(1)=mid$(map$(1),1,moveX-1)+"0"+mid$(map$(1),moveX+1,len(map$(1)-moveX)

basically use mid$ command to take all the digits before and after the postition thats being editied

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: Strings Strings and more Strings
« Reply #24 on: December 17, 2011, 09:43:57 PM »
I got most of this worked out already, I'll post when it does more than just walk around a room. ;)
...But right now I have no Mac 'cause I'm on a road trip.
Warning: The above post may have been modified multiple times.

"In a great game, the character must never perfectly obey the user's command"
 - Tim Rogers

http://connorspuzzles.tumblr.com/