|
Post by johnno56 on Mar 21, 2019 2:16:19 GMT -6
I am trying my hand at making a simple platformer with RC. I originally started this some years back using sdlbasic and it kind of got left "on the shelf". This is "old school". Read a text file; translate to a graphic; display the game... My problem is speed... On sdlbasic it ran ok. But with RC it runs too fast !! I have had to insert a "wait" command to get it to slow down but then it kind of "jitters" across the screen. The game is only one screen and the player can only move around. There is no interaction as yet. Open to suggestions. J platformer1.zip (173.91 KB)
|
|
|
Platformer
Mar 21, 2019 10:20:44 GMT -6
via mobile
Post by tbird on Mar 21, 2019 10:20:44 GMT -6
DeltaTime......DeltaTime....DeltaTime....
Need I say more.
Movements should always be thought of in pixels per second, not pixels per frame.
|
|
|
Post by tbird on Mar 21, 2019 11:36:24 GMT -6
I guess I should have looked at your code before replying, your movements are entirely grid based...sorry. What you want to do is interpolate your movement from the current grid position to the new grid position. I would try an explanation here but I am most likely to fail to convey what I mean, lol. So I will attempt to provide an quick example.
|
|
|
Post by tbird on Mar 21, 2019 12:27:00 GMT -6
Almost got an example done...have to go Load a B-Train with Canola will upload as soon as I get back.
|
|
|
Post by johnno56 on Mar 21, 2019 13:09:49 GMT -6
Load a what with what?
|
|
|
Platformer
Mar 21, 2019 14:25:26 GMT -6
via mobile
Post by tbird on Mar 21, 2019 14:25:26 GMT -6
1 Btrain loaded waiting on second truck so be a couple hours yet.
|
|
|
Post by johnno56 on Mar 21, 2019 14:52:40 GMT -6
Just Google'd "btrain" ... confused with your answer that included "train" and "truck" ... confusion is gone... Couple (or more) hours then... Take care.
J
|
|
|
Post by tbird on Mar 21, 2019 19:51:02 GMT -6
Had supper with my parents also...so it took longer . But as promised, here is an example of smooth grid/tile based movement I didn't test it thoroughly, it should give you a good idea of how to move smoothly and at whatever speed you wish.
|
|
|
Post by johnno56 on Mar 21, 2019 20:40:50 GMT -6
Supper? It's just past lunchtime here in Melbourne...
That IS a smooth movement... At the moment, my player, looks like he's going through caffeine withdrawal...
I had just finished a rough "Level 1" when your message popped in... I'll go over your example and see if I can modify my game. (for want of a better word... lol) Don't hold your breath waiting... lol
Thank you for the example.
J
|
|
|
Post by tbird on Mar 21, 2019 21:04:11 GMT -6
No worries, I hope it helps. Yes your character is a jittery little bugger. I messed up a little, the values for how much the player moves and jumps should be variables not set numbers, saves headaches later on when adjusting such things...oh well I was in a hurry lol. I am looking forward to your update.
Edit: Sorry it was bugging me too much...fixed example
|
|
|
Post by johnno56 on Mar 22, 2019 0:38:39 GMT -6
Very nice. Was that a little friction I saw there or was it just a side effect of applying delta? lol I completed level one but haven't been brave enough to modify it yet... If I can work out how to add an extra level, and it works properly, I'm probably going to need some assistance in modifying it for delta. You wouldn't happen to know someone who would possess the necessary skills... would you by any remote chance? In the meantime, I will attack level one... (ignore the "X" and "Y" - debugging... lol) platformer2.zip (417.08 KB)
|
|
|
Post by tbird on Mar 22, 2019 8:46:18 GMT -6
Any assistance I can provide, I will be happy to.
|
|
|
Post by johnno56 on Mar 28, 2019 15:19:11 GMT -6
I think I have worked out how to add levels. I am not happy with the way the "updateObject" and "checkExit" routines are handling the way the level ends. It works but seems to be a bit of a dog's breakfast. I would appreciate it if someone could check the logic? Levels 2 and 3 are very simple layouts. Just to check the level change. I am going for function rather than aesthetics for now. As usual, any suggestions or criticisms, are appreciated... J platformer3.zip (417.78 KB)
|
|
|
Platformer
Mar 30, 2019 10:06:55 GMT -6
via mobile
Post by tbird on Mar 30, 2019 10:06:55 GMT -6
I finally got around to downloading it, not bad so far, I am going to attempt to smooth the movement out a bit while keeping your coding intact.
|
|
|
Post by johnno56 on Mar 31, 2019 4:03:17 GMT -6
Well, I have perfected - maybe not 'perfected' - level creation. As I have used Tiled in the past, and kind of familiar with it, I can now whip up a simple 20x15 tile 'room' in under 10 minutes. Then export it as a CSV file; make a few tweaks; save as a text file. A few extra tweaks to the game and it's done. Almost like a production line... lol I am going to add a few more tiles to the tileset and try to introduce some 'hazards'. I'm not too certain as to how to add animated 'enemies' and would be guessing in regards to animated hazards, but it looks like it's going to be fun to find out...
I have been experimenting with different tilesets. The game seems to "look" ok with the current set. Might try backgrounds etc... But I don't want to have the game "too busy". I prefer to keep it simple. If anyone can suggest a layout or a tileset that will improve the game please suggest... images or hand sketches would be great.
"Rooms" seem to be a good place to start but I would like to move towards a "mario-style" platformer that either parallaxes or scrolls in one direction with a 'fixed camera' effect... Too much, too soon?
The back is much better and can tolerate longer periods at the keyboard. Time to either make or grab public domain tiles...
|
|