Author Topic: Lemmings in C#  (Read 15615 times)

0 Members and 1 Guest are viewing this topic.

Offline namida

  • Administrator
  • Posts: 12399
    • View Profile
    • NeoLemmix Website
Re: Lemmings in C#
« Reply #15 on: May 20, 2015, 04:37:32 PM »
If it helps, you can get the Lemmix source code here. It can be a tad hard to follow; it's also written in Delphi rather than C# but if you have a decent amount of programming knowledge, you should be able to follow it. (I was able to understand some C# code mostly just based on my Delphi knowledge, at least to enough of an extent to work out how a program worked.) It might help you work out how stuff is done.

https://www.dropbox.com/s/i1gum9va0m7fr3z/PlayerSource_V28.zip

SuperLemmini and Lix are also open-source (SuperLemmini is Java and... not sure whether Lix is C or C++, but it's one of them), which may also be of help to you. NeoLemmix source can also be provided on request if you feel it'll help, though in terms of how it handles switching levels it's almost identical to regular Lemmix.
My Lemmings projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)

Offline Simon

  • Administrator
  • Posts: 3876
    • View Profile
    • Lix
Re: Lemmings in C#
« Reply #16 on: May 21, 2015, 12:17:51 AM »
With OOP, the first idea is to have the entire play in a large class, and reinstantiate the class. Since this is unwieldy, the next idea is to have savestates as components in the game class, and go back to a savestate from the very beginning.

-- Simon

Offline oskar12345

  • Posts: 39
    • View Profile
Re: Lemmings in C#
« Reply #17 on: May 22, 2015, 09:06:07 AM »
i'm really noob with classes, i never used it. i need to study more... i understand the concepts but i need more practice..
i'll try to implement like dos only with ifs, conditions and structs that i initialize when  i change levels if it's possible

for this reason i'll upload the source code if someone can help.it'll be great.
« Last Edit: May 22, 2015, 09:16:22 AM by oskar12345 »

Offline namida

  • Administrator
  • Posts: 12399
    • View Profile
    • NeoLemmix Website
Re: Lemmings in C#
« Reply #18 on: May 22, 2015, 12:07:25 PM »
It's well worth learning them. They're not overly difficult to use, and extremely powerful.
My Lemmings projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)

Offline Simon

  • Administrator
  • Posts: 3876
    • View Profile
    • Lix
Re: Lemmings in C#
« Reply #19 on: May 22, 2015, 05:11:26 PM »
I've skimmed the source.

You are already using a struct for the lemming. You can implement what I have suggested with all-public structs and normal functions. I.e., you don't need inheritance, you don't need virtual methods, ...

This is a general observation: A language is a toolbox, you don't need to use every tool.

For readable source, try to keep your identifier names in English. Comments in English are also preferred.

-- Simon

Offline oskar12345

  • Posts: 39
    • View Profile
Re: Lemmings in C#
« Reply #20 on: May 31, 2015, 06:13:13 PM »
here it's the beta 2. All the levels on one exe
almost finish defining all traps drawing,background parallax,rectangles for logic,logic steels,arrows...etc.
All are in structs for future addings (level images,traps,new sprites,doors,exits,whatever), only have to code some lines on the source.

https://mega.co.nz/#!zgMSXB4Y!UdULyejRbZayXq3kXMTKqj3HoszOrKZs6er02MASoTM
« Last Edit: June 02, 2015, 02:14:48 PM by oskar12345 »