Scrolling Game Development Kit Forum
SGDK Version 2 => Help, Errors, FAQ => Topic started by: wildman will22 on 2008-01-05, 09:50:07 PM
-
I CANNOT GET MY SPRITES TO MOVE. I can't. I just can't. >:(
I've tried everything. OK, not everything, but I just got SGDK 2 yesterday.
So, could anyone tell me how just to make the sprite move. (The first thing I tried was the tutorial, and that DEFINETLY didn't work) :crazy:
-
ahh read the tutorial again.
Maybe ur keyboard isnt working?
seriously we need more info, just saying ur sprites dont move and u did the tut doesnt explain anything, as other ppl have done the tut and had their's working.
-
Sorry, I start to vent when electronics don't work right.
Basically, I'm totally new to this, but I have quite a bit of experience with Gamemaker. SGDK 2 is much more complex, but also much more powerful. (and it's much easier to do very difficult things)
I'm pretty sure my keyboards working or else I would be typing this.So, it's not that. All I need to know is how you would make simple "player" sprite move around using the keyboard. If I know this, I'm pretty sure I can figure out the rest on my own.
-
did you do the part where it says: make a plan and there a rule which says "map input to player" ?
this rule can be created in the rule tree of the player, too (i think), and it is necessary for moving the sprite to left/right when you press left/right on your keyboard.
there must also be a rule (on a plan i think), which says that your sprite indeed IS the player.
but i think you should really try again the tut. sometimes it may be very tricky, all this huge mass of text, but it works when you really try not to miss a line.
-
Yes, you might have to make sure you got the tutorial done correctly. Also, use the new version of the tutorial at http://sgdk2.sf.net/Documentation/Tutorial1.html (http://sgdk2.sf.net/Documentation/Tutorial1.html) because there were a few unrelated minor problems with the version in the release. If you still can't figure it out, post your project at http://sgdk2.enigmadream.com/support/ (http://sgdk2.enigmadream.com/support/) and I can tell you what's missing.
-
K, now that I have my head on str8. What do I need to do to get a sprite to change shape? Like conditions etc.
Sorry I'm such a pain :P, but I can't figure it out on my own!
-
you would need an if-condition or sth similar.
e.g.:
if ....
SwitchToState
for "if" you could take almost everything, like a parameter you give the sprite, or a counter, a map flag, whatever you want.
the best example is the tut about make the sprite walking.
when you change the condition, e.g. " if MapFlag 1 is On", you could have events in your game, which turn the map flag on or off. and so you sprite could change shape, by switching to another state.
-
Have you looked at the SGDK2 sample project? The player sprite can change between facing left and facing right. If you can see how that works, you should be able to see how a sprite could change shape. Instead of left and right, just use two states that are different shapes. To find these rules, look at the rules tab of the player sprite definition. Expand "If climbing" and look near the end of that list -- you will see "If moving left". Since this rule is below the "Else" it only applies when the sprite is not climbing. If you expand the "If moving left" rule, you'll see a rule called "then face left" that shows you how to switch the sprite to a new state, which could just as easily switch to a state that is a different shape.
-
Well, I've tried to use the "Switchtostate" rule, but it won't do anything. I've tried it on it's own, If isinputpressed, and I just tried it with a map flag like morgen above you suggested, and the sprite won't change. Is there anything that could be hindering the sprite from changing states?
-
did you make sure the other state is easily recognisable from the first state? i thought mine wasn't working then I realized i had both of the states face left, so it appeared they didnt change. :-[
-
Are you trying SwitchToState in the sample project, or a new project of your own? If it's in the sample project, it might be tricky for two reasons: 1) The SwitchToState rule might not be getting applied, depending on where you put it; 2) Other rules might be switching it back. So you might have to follow every rule to see what else might be going on, which can be tricky even for an experienced programmer. You might want to try it in a simple project of your own. If you can't figure it out, you can submit your project at http://sgdk2.enigmadream.com/support/ (http://sgdk2.enigmadream.com/support/) and I can look into it.
-
I just figured out what I was doing wrong...and I feel like total idiot...
Ah well, that was to be expected...
ps: I was trying to change to a state that was animated, but I didn't give the sprite a rule to animate >:(.(I probably shoulda told you that) :-[