Pages: 1 [2] 3
  Print  
Author Topic: ENIGMA examples - Graphics: 98% done  (Read 3233 times)
Offline (Male) Josh @ Dreamland
Reply #15 Posted on: November 11, 2010, 04:12:15 PM

Prince of all Goldfish
Developer
Location: Ohio, United States
Joined: Feb 2008
Posts: 2264

View Profile Email
Code: (C) [Select]
void action_bounce(int precise, int solid) {
 if (((enigma::object_planar*)enigma::instance_event_iterator->inst)->x < 32
  || ((enigma::object_planar*)enigma::instance_event_iterator->inst)->x > room_width - 64)
   ((enigma::object_planar*)enigma::instance_event_iterator->inst)->hspeed = -((enigma::object_planar*)enigma::instance_event_iterator->inst)->hspeed;
 if (((enigma::object_planar*)enigma::instance_event_iterator->inst)->y < 32
  || ((enigma::object_planar*)enigma::instance_event_iterator->inst)->y > room_height - 64)
   ((enigma::object_planar*)enigma::instance_event_iterator->inst)->vspeed = -((enigma::object_planar*)enigma::instance_event_iterator->inst)->vspeed;
}

PLEASE do something like this:

Code: (C) [Select]
void action_bounce(int precise, int solid)
{
  enigma::object_planar* const inst = ((enigma::object_planar*)enigma::instance_event_iterator->inst);
  if (inst->x < 32 || inst->x > room_width - 64)
    inst->hspeed = -inst->hspeed;
  if (inst->y < 32 || inst->y > room_height - 64)
    inst->vspeed = -inst->vspeed;
}

But I'm quite happy you got that example working.

Fixed: edited in a const.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Female) IsmAvatar
Reply #16 Posted on: November 11, 2010, 10:23:00 PM

LateralGM Developer
LGM Developer
Location: Pennsylvania/USA
Joined: Apr 2008
Posts: 833

View Profile Email
Done. Also added bbox-based place_free and place_meeting, which means that collisions now use an ad-hoc bbox collision system.

Edit: place_free now also does solid check. Fixed typo/bug with action_move_random using room_width instead of room_height to determine y.
« Last Edit: November 11, 2010, 10:31:30 PM by IsmAvatar » Logged
Offline (Male) Fede-lasse
Reply #17 Posted on: November 12, 2010, 03:03:04 AM

AI Programmer
Fede
Location: Denmark, Europe
Joined: Oct 2008
Posts: -2342534e-10
MSN Messenger - lasse1706@hotmail.com
View Profile WWW Email
What?

Off-topic question: Are you going to imitate GM bugs/glitches/weird behaviours, like not being able to move a solid object once it's stuck in another object?
« Last Edit: November 12, 2010, 03:17:39 AM by Fede-lasse » Logged
Call me Fede.
Offline (Male) Josh @ Dreamland
Reply #18 Posted on: November 12, 2010, 10:33:02 AM

Prince of all Goldfish
Developer
Location: Ohio, United States
Joined: Feb 2008
Posts: 2264

View Profile Email
We won't be mimicking glitches. Setting x to xprevious and y to yprevious for solid collisions is a part of GM, not a glitch.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Female) IsmAvatar
Reply #19 Posted on: November 16, 2010, 01:33:20 AM

LateralGM Developer
LGM Developer
Location: Pennsylvania/USA
Joined: Apr 2008
Posts: 833

View Profile Email
With revision 538 fixing the collision bbox to account for the origin, and a minor coding adjustment to factor for the fact that Enigma doesn't store the 'solid' state of an object, I was able to get the example working perfectly. I've also included an empty action_set_alarm function so that the original Catch The Clown works flawlessly sans suddenly changing direction every couple of seconds (intended behavior in the original game to add complexity. Enigma doesn't support Alarms in Definitions yet, so I couldn't code it).

As far as Catch The Clown goes, the original uses a Midi sound, and Enigma doesn't support Midi, so I'd recommend converting your midi's into wav or ogg. If you're using Ubuntu, Timidity++ will do in a snap:
Code: [Select]
$ sudo apt-get install timidity
$ timidity -Ov music.mid
Where "music.mid" is the location/name of the midi. The resulting file will be output as "music.ogg". To do .wav instead, use -Ow instead of -Ov

If you don't do the conversion, enigma will simply discard the offending sound.
The original Catch The Clown's background will not show up. I think backgrounds still aren't fully supported in Enigma yet.
« Last Edit: November 16, 2010, 01:37:07 AM by IsmAvatar » Logged
Offline (Male) Fede-lasse
Reply #20 Posted on: November 16, 2010, 05:57:39 PM

AI Programmer
Fede
Location: Denmark, Europe
Joined: Oct 2008
Posts: -2342534e-10
MSN Messenger - lasse1706@hotmail.com
View Profile WWW Email
Finished the Pacman-styled version of the treasure example and replaced many sprites in the maze example using the Egyptian sprites. I'm still providing the Egyptian-styled treasure example, though.

EDIT: @Josh, when I'll make the sounds for the examples, I'll use the Pacman sounds for the treasure example. That's why I didn't make the countdown effect.
« Last Edit: November 17, 2010, 02:47:04 AM by Fede-lasse » Logged
Call me Fede.
Offline (Female) IsmAvatar
Reply #21 Posted on: November 19, 2010, 08:20:23 AM

LateralGM Developer
LGM Developer
Location: Pennsylvania/USA
Joined: Apr 2008
Posts: 833

View Profile Email
Topic Split. MIDI discussion has been split to here: http://enigma-dev.org/forums/index.php?topic=683.0 (in the Sound and Music area)
Logged
Offline (Male) Fede-lasse
Reply #22 Posted on: November 19, 2010, 09:38:11 AM

AI Programmer
Fede
Location: Denmark, Europe
Joined: Oct 2008
Posts: -2342534e-10
MSN Messenger - lasse1706@hotmail.com
View Profile WWW Email
Topic Split. MIDI discussion has been split to here: http://enigma-dev.org/forums/index.php?topic=683.0 (in the Sound and Music area)
And it was about time...
Logged
Call me Fede.
Offline (Male) Fede-lasse
Reply #23 Posted on: November 29, 2010, 10:39:28 AM

AI Programmer
Fede
Location: Denmark, Europe
Joined: Oct 2008
Posts: -2342534e-10
MSN Messenger - lasse1706@hotmail.com
View Profile WWW Email
Finished Catch the Clown. I also made the penismusic in this one xd gay
Logged
Call me Fede.
Offline (Male) Josh @ Dreamland
Reply #24 Posted on: November 29, 2010, 06:31:13 PM

Prince of all Goldfish
Developer
Location: Ohio, United States
Joined: Feb 2008
Posts: 2264

View Profile Email
Your mix between gradated effects and shrunken pictures is almost disturbing in click the clown. The... f... bah, never mind.
I can't hear any of the sounds for ENIGMA reasons, but yeah.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Male) Fede-lasse
Reply #25 Posted on: November 30, 2010, 02:44:44 AM

AI Programmer
Fede
Location: Denmark, Europe
Joined: Oct 2008
Posts: -2342534e-10
MSN Messenger - lasse1706@hotmail.com
View Profile WWW Email
i leki itt11! stfu!!!!!!!!!!!!!!!!!

edet: i m8 space cl33ner spaceshit LOL look goooood bye texturising it and thinsg, i also m8 bl0kz lock bettere in lolcat XD the clown

edett2 :sry had 2 correct spellin errorz

Your mix between gradated effects and shrunken pictures is almost disturbing in click the clown. The... f... bah, never mind.
I can't hear any of the sounds for ENIGMA reasons, but yeah.
OMG DOUTCHE!!!!!!!! ITS A CARE4LY EDITIED TEXXXTURE BADASSSSS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
« Last Edit: November 30, 2010, 07:00:36 AM by Fede-lasse » Logged
Call me Fede.
Offline (Male) Josh @ Dreamland
Reply #26 Posted on: November 30, 2010, 08:59:06 AM

Prince of all Goldfish
Developer
Location: Ohio, United States
Joined: Feb 2008
Posts: 2264

View Profile Email
;__;

WHAT are we BREEDING?
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Female) IsmAvatar
Reply #27 Posted on: November 30, 2010, 12:22:32 PM

LateralGM Developer
LGM Developer
Location: Pennsylvania/USA
Joined: Apr 2008
Posts: 833

View Profile Email
:troll:
Logged
Offline (Male) Fede-lasse
Reply #28 Posted on: December 06, 2010, 03:57:41 AM

AI Programmer
Fede
Location: Denmark, Europe
Joined: Oct 2008
Posts: -2342534e-10
MSN Messenger - lasse1706@hotmail.com
View Profile WWW Email
We won't be mimicking glitches. Setting x to xprevious and y to yprevious for solid collisions is a part of GM, not a glitch.
I just want to point out that even things like move_outside_all/solid() won't work... I think. And that's bad for a "solid" feature that renders collisions useless.

EDIT: Finished 3-Dimensional Games. I edited the code in a couple of the examples to make the depth effects look better.

EDIT 2: Updated 3-Dimensional Games. Retep was so nice that he decided to make a tile smoother that made interpolated versions of different tiles for me, so that I could make a complete tileset without spending ages doing it in GIMP or something. Kudos to him.

EDIT 3: Finished the 1945 example that I decided to name 9000 instead with American/Russian stealth bombers/jets flying around and shooting each other or something. Yes, I have nothing better to do here at school.

EDIT 4: Finished Maze Games.

EDIT 5: Fixed the room speed in the Pacman (treasure) example, because it was slow and laggish. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
« Last Edit: December 07, 2010, 08:30:21 AM by Fede-lasse » Logged
Call me Fede.
Offline (Male) Fede-lasse
Reply #29 Posted on: December 13, 2010, 04:08:47 AM

AI Programmer
Fede
Location: Denmark, Europe
Joined: Oct 2008
Posts: -2342534e-10
MSN Messenger - lasse1706@hotmail.com
View Profile WWW Email
lol double post.

Finished Platform Games.

EDIT: Finished thee street racing exampl0z.
« Last Edit: December 13, 2010, 07:50:04 AM by Fede-lasse » Logged
Call me Fede.
Pages: 1 [2] 3
  Print