Author Topic: Side-scrolling Adventure Game help [SOLVED]  (Read 660 times)

Stranga

  • Zzz...
    • I can help with making music
    • I can help with story design
Side-scrolling Adventure Game help [SOLVED]
« on: 21 Oct 2019, 02:55 »
Hello everyone,

I would like to know if there is a better way of implimenting a side-scrolling adventure game. I am currently developing one and I've noticed the system I'm using is a little jarring. The character walks left and right fine, but when inspecting a hotspot/region/object he lift/drops a pixel or two above or below the ground rather than stay on the ground (if it is making sense)

Screen: Here is how the game looks.
Spoiler: ShowHide



Here is how I'm currently making the walking method.



I'm also using keyboard controls only, since I want to port my games to consoles in the near future.

Any help will be greatly appreciated, thank you all!
« Last Edit: 24 Oct 2019, 02:05 by Stranga »
Follow me on twitter: https://twitter.com/StrangaGames

Re: Side-scrolling Adventure Game help
« Reply #1 on: 21 Oct 2019, 08:41 »
Are you using the Keyboard Module?
Have you found out why they move down a pixel? Are you using WalkTo points for hotspots? How do you trigger interacting with a hotspot?
Fail at Floaty Rog' now!  still having to deal with what games are going through

eri0o

Re: Side-scrolling Adventure Game help
« Reply #2 on: 21 Oct 2019, 13:57 »
Hey Stranga, I have open sourced some stuff which may or may not be relevant to you, so I will leave them below in case anything is useful.

An open source game using same approach for 2D sidescroller: Hell's Puppy

Alternative Keyboard/Joystick control to Khris Keyboard Module : Controlz

Realistic 2D physics, has a small demo for sidescroller with keyboard control: AgsBox2D

A simple arcady platformer, not the focus of the code but may be useful: rellax module demo


Stranga

  • Zzz...
    • I can help with making music
    • I can help with story design
Re: Side-scrolling Adventure Game help
« Reply #3 on: 22 Oct 2019, 13:53 »
@Khris I am using a keyboard module but I think the problem lies within the room editor's WalksToPoint before the hotspot triggers. I don't necessarily need it, but it's just nice to position the player without having to add the WalksToPoint in the room's script. But to get it to work without the pixel jump up/down it has to be exactly on the y.position of the player. This becomes tedious, especially on levels with a tall room.

@eri0o Thanks for sharing some ideas. I do like the rellax module! Trying the demo now.
Follow me on twitter: https://twitter.com/StrangaGames

Cassiebsg

  • Cavefish
  • Fleeing the Cylon tyrrany...
    • Cassiebsg worked on one or more games that won an AGS Award!
    •  
    • Cassiebsg worked on one or more games that was nominated for an AGS Award!
Re: Side-scrolling Adventure Game help
« Reply #4 on: 22 Oct 2019, 18:44 »
In script you can just use player.y instead of the the actual y.  ;) This would of course mean you need to drop the room editor's WalksToPoints.

If typing player.Walk(x, player.y, and so on) is too much. You could just write a small function, so that you could do:

Walk(70); (where 70 is the x)
or
Walk(spot); (this would be a string).

The function could then look like:
Code: [Select]
function Walk(int spotX)
{
  player.Walk(spotX, player.Y, eBlock, eWalkableAreas);
}
There are those who believe that life here began out there...

Stranga

  • Zzz...
    • I can help with making music
    • I can help with story design
Re: Side-scrolling Adventure Game help
« Reply #5 on: 23 Oct 2019, 00:24 »
That's actually not a bad idea @Cassiebsg! I'll give that a try :-D
Follow me on twitter: https://twitter.com/StrangaGames