Topic:   Another Platformer   (Read 9081 times)


0 Members and 1 Guest are viewing this topic.

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Another Platformer
« on: January 16, 2012, 02:07:14 PM »
https://sites.google.com/site/onronc/SquareDude.scproj?attredirects=0&d=1
This is cool but it gets stuck because the method addobject doesn't seem to return a number besides 0. I'll keep trying to fix it but I could use a little help.
EDIT: Fixed. There's this weird thing where methods want parenthesis but ONLY when they return a value.
EDIT 2: Replaced file with one that has working tiles + sprite motion test. The hat works fine!
MORE EDIT: If I complete enough of this engine I think I'll save a separate version to put in Code Exchange. It will be the Map Collision Engine where you create objects that move based on the given velocity and collide with tiles. I'm setting it up to use the same code for any collision object. Would this officially be fake SC OOP?
« Last Edit: January 16, 2012, 02:54:14 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/

Circuit


  • GMG-er

  • **


  • Posts: 299

  • blast from the past
Re: Another Platformer
« Reply #1 on: January 16, 2012, 03:12:07 PM »
It sounds interesting, but I can't play it!  This happens when I click New Game:

Scripting Exception
Event: Global Open Game Event, Line 18
Error: Array out of bounds.

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: Another Platformer
« Reply #2 on: January 16, 2012, 03:22:47 PM »
Huh. I was sure I uploaded the right save, lemme get back to you.
EDIT: Updated file in the same first link.
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/

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: Another Platformer
« Reply #3 on: January 16, 2012, 04:08:30 PM »
So now I have to re-create something and don't exactly remember how. It needs to return what's on a tile exactly precisely based on an x and y position on the screen. Current check: x and y divided by size of tiles, rounded down. This offsets by half a tile. I'll probably work it out myself, I know why it's broken.
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/

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: Another Platformer
« Reply #4 on: January 20, 2012, 09:38:51 PM »
I'm nearly done with the movement, it's all custom-built collision detection!
https://sites.google.com/site/onronc/SquareDude.scproj?attredirects=0&d=1
Updated the file, use arrow to see how he moves at a given speed unless there's a wall. And he hits the edge exactly and there's no jittering. Should work at speeds up to the tile size minus one but that's fast enough. (31 pixels at a time)
Now I add gravity and friction and all that jazz. Should be able to use the hit test for negtive velocity from gravity to see what block he's on.
« Last Edit: January 20, 2012, 09:52:41 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/

EqwanoX


  • Administrator

  • GMG Extraordinaire

  • *****


  • Posts: 1180
Re: Another Platformer
« Reply #5 on: January 21, 2012, 07:53:48 AM »
it works now! looks like its coming along. this would make a good overhead view game as it is, i tryed makeing a map in it and noticed it doesnt build the last line of the right and bottom side of screen. are there gonna be enemies?

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: Another Platformer
« Reply #6 on: January 21, 2012, 12:05:34 PM »
It skipped a line? I'll look into it... And oh yes there will be enemies.
I may or may not try to make it scrolling but it's a possibility. It would greatly improve the ability to design interesting levels.
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/

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: Another Platformer
« Reply #7 on: January 22, 2012, 05:37:41 PM »
Using the attachments now since it's quick.
I got a lot of this working and finally noticed the last row and column of the map won't draw. I can't figure out why! But I got some slick controls in the works, added special code for turning faster. 8)
Anyone mind helping with this drawing glitch? I'd appreciate it.

EDIT:
Code: [Select]
maptile$(25,18)
this returns "" (meaning NOTHING) which explains why drawing and collision with these tiles won't work. Why is maptile$ broken?
Hatred for fake nthfield$ arrays is growing... >:(

EDIT 2: Replacing file with a new one where up is jump, HOLD UP TO JUMP MOAR!!1!!@!!eleven!!!!11!!! :D HE CAN JUMP NOW.

*ahem* sorry 'bout that. Had to much sugar before.
EDIT 3: "updatespeed" is now how many frames it skips, in case it runs slow.
I'm gonna add a fall speed limit and tweak the game feel a lot before I'm done.
« Last Edit: January 22, 2012, 05:58:09 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: Another Platformer
« Reply #8 on: January 22, 2012, 06:52:39 PM »
That's really epic! I love the physics.

One suggestion: Add some friction when he's on a block. I slip too much.

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: Another Platformer
« Reply #9 on: January 22, 2012, 09:45:11 PM »
There is friction! I've since upped the friction... As I said was tweaking the physics of it a lot today and I have a good idea of how I'll tune it. I can change the falling speed and the gravity for how fast the jumps go and how much you hold down jump to go higher and the friction... and it applies a bit more velocity when he turns, so you can do cool stunts and it feels tighter. I changed it so that none of it was really hard-coded. It's just too much fun to play with. :P
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/

Circuit


  • GMG-er

  • **


  • Posts: 299

  • blast from the past
Re: Another Platformer
« Reply #10 on: January 23, 2012, 12:50:32 AM »
This is great.  It's awesome that you can change physical things such as speed, friction etc..  I can learn a lot about physics from this code.   :D

EDIT:
Code: [Select]
maptile$(25,18)
this returns "" (meaning NOTHING) which explains why drawing and collision with these tiles won't work. Why is maptile$ broken?
Hatred for fake nthfield$ arrays is growing... >:(
I figured it out.  The code says "if x < 25" and "if y < 18".  It should say "if x <= 25" and "if y <= 18".

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: Another Platformer
« Reply #11 on: January 23, 2012, 07:08:35 AM »
Oh thanks bro! Well, that should have been pretty obvious. ::) Well, gotta come back n' fix it this afternoon. And I definitely want to look into changing the display for map scrolling, as tricky as it is larger levels would be so fun. I'd make it full screen if Silver Creator wasn't so likely to just lag from more sprites. If it didn't on mine it would for a lot of people.
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/